Changeset 1508
- Timestamp:
- 08/10/07 17:16:25
- Files:
-
- trunk/deployment/webadmin/webapp/resources/default/default/default.xsl (modified) (3 diffs)
- trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js (modified) (2 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl (modified) (3 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkEventForm.js (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webadmin/webapp/resources/default/default/default.xsl
r1506 r1508 1204 1204 <xsl:if test="form/recurringEntity = 'true'"><xsl:attribute name="class">visible</xsl:attribute></xsl:if> 1205 1205 1206 <!-- show or hide rrules fields: --> 1207 <input type="checkbox" name="rrulesFlag" onclick="swapRrules(this)" value="on"/> 1208 <span id="rrulesSwitch"> 1209 <xsl:choose> 1210 <xsl:when test="form/recurrence"> 1211 change recurrence rules 1212 </xsl:when> 1213 <xsl:otherwise> 1214 create recurrence rules 1215 </xsl:otherwise> 1216 </xsl:choose> 1217 </span> 1218 <span id="rrulesUiSwitch" class="invisible"> 1206 <!-- show or hide rrules fields when editing: --> 1207 <xsl:if test="form/recurrence"> 1208 <input type="checkbox" name="rrulesFlag" onclick="swapRrules(this)" value="on"/> 1209 <span id="rrulesSwitch"> 1210 change recurrence rules 1211 </span> 1212 </xsl:if> 1213 <span id="rrulesUiSwitch"> 1214 <xsl:if test="form/recurrence"> 1215 <xsl:attribute name="class">invisible</xsl:attribute> 1216 </xsl:if> 1219 1217 <input type="checkbox" name="rrulesUiSwitch" value="advanced" onchange="swapVisible(this,'advancedRrules')"/> 1220 1218 show advanced recurrence rules … … 1339 1337 1340 1338 <!-- wrapper for rrules: --> 1341 <table id="rrulesTable" cellspacing="0" class="invisible"> 1339 <table id="rrulesTable" cellspacing="0"> 1340 <xsl:if test="form/recurrence"> 1341 <xsl:attribute name="class">invisible</xsl:attribute> 1342 </xsl:if> 1342 1343 <tr> 1343 1344 <td id="recurrenceFrequency" rowspan="2"> … … 1607 1608 </table> 1608 1609 <!-- recurrence dates (rdates) --> 1609 <div id="recurrenceDatesButton"> 1610 <input type="button" value="manage recurrence & exception dates" onclick="launchSizedWindow('{$event-showRdates}','700','500')"/> 1610 <!--<div id="recurrenceDatesButton"> 1611 <input type="button" value="manage recurrence & exception dates" onclick="launchSizedWindow('{$event-showRdates}','560','400')"/> 1612 </div>--> 1613 <h4 id="dialogTitle"> 1614 Recurrence and Exception Dates 1615 </h4> 1616 <div id="raContent"> 1617 <div class="dateStartEndBox" id="rdatesFormFields"> 1618 <div class="dateFields"> 1619 <input name="eventRdate.date" 1620 dojoType="dropdowndatepicker" 1621 formatLength="medium" 1622 value="today" 1623 saveFormat="yyyyMMdd" 1624 id="bwEventWidgeRdate" 1625 iconURL="{$resourcesRoot}/resources/calIcon.gif"/> 1626 </div> 1627 <div id="rdateTimeFields" class="timeFields"> 1628 <select name="eventRdate.hour"> 1629 <option value="00">00</option> 1630 <option value="01">01</option> 1631 <option value="02">02</option> 1632 <option value="03">03</option> 1633 <option value="04">04</option> 1634 <option value="05">05</option> 1635 <option value="06">06</option> 1636 <option value="07">07</option> 1637 <option value="08">08</option> 1638 <option value="09">09</option> 1639 <option value="10">10</option> 1640 <option value="11">11</option> 1641 <option value="12" selected="selected">12</option> 1642 <option value="13">13</option> 1643 <option value="14">14</option> 1644 <option value="15">15</option> 1645 <option value="16">16</option> 1646 <option value="17">17</option> 1647 <option value="18">18</option> 1648 <option value="19">19</option> 1649 <option value="20">20</option> 1650 <option value="21">21</option> 1651 <option value="22">22</option> 1652 <option value="23">23</option> 1653 </select> 1654 <select name="eventRdate.minute"> 1655 <option value="00" selected="selected">00</option> 1656 <option value="05">05</option> 1657 <option value="10">10</option> 1658 <option value="15">15</option> 1659 <option value="20">20</option> 1660 <option value="25">25</option> 1661 <option value="30">30</option> 1662 <option value="35">35</option> 1663 <option value="40">40</option> 1664 <option value="45">45</option> 1665 <option value="50">50</option> 1666 <option value="55">55</option> 1667 </select> 1668 <xsl:text> </xsl:text> 1669 1670 <select name="tzid" id="rdateTzid" class="timezones"> 1671 <xsl:if test="form/floating/input/@checked='checked'"><xsl:attribute name="disabled">disabled</xsl:attribute></xsl:if> 1672 <option value="-1">select timezone...</option> 1673 <xsl:variable name="rdateTzId" select="/bedework/rdates/tzid"/> 1674 <xsl:for-each select="/bedework/timezones/timezone"> 1675 <option> 1676 <xsl:attribute name="value"><xsl:value-of select="id"/></xsl:attribute> 1677 <xsl:if test="$rdateTzId = id"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 1678 <xsl:value-of select="name"/> 1679 </option> 1680 </xsl:for-each> 1681 </select> 1682 </div> 1683 <xsl:text> </xsl:text> 1684 <!--bwRdates.update() accepts: date, time, allDay, floating, utc, tzid--> 1685 <input type="button" name="rdate" value="add recurrence" onclick="bwRdates.update(this.form['eventRdate.date'].value,this.form['eventRdate.hour'].value + this.form['eventRdate.minute'].value,false,false,false,this.form.tzid.value)"/> 1686 <input type="button" name="exdate" value="add exception" onclick="bwExdates.update(this.form['eventRdate.date'].value,this.form['eventRdate.hour'].value + this.form['eventRdate.minute'].value,false,false,false,this.form.tzid.value)"/> 1687 <br/> 1688 <!-- dateonly (anniversary) event: this is temporary - should be determined by the main event --> 1689 <input type="checkbox" name="dateOnly" id="rdateDateOnly" onclick="swapRdateAllDay(this)" value="true"/> 1690 all day 1691 <!-- floating event: no timezone (and not UTC) --> 1692 <input type="checkbox" name="floating" id="rdateFloating" onclick="swapRdateFloatingTime(this)" value="true"/> 1693 floating 1694 <!-- store time as coordinated universal time (UTC) --> 1695 <input type="checkbox" name="storeUTC" id="rdateStoreUTC" onclick="swapRdateStoreUTC(this)" value="true"/> 1696 store as UTC 1697 </div> 1698 1699 <!-- if there are no recurence dates, the following table will show --> 1700 <table cellspacing="0" id="bwCurrentRdates"> 1701 <tr><th>Recurrence Dates</th></tr> 1702 <tr><td>No recurrence dates</td></tr> 1703 </table> 1704 1705 <!-- if there are no recurence dates, the following table will show --> 1706 <table cellspacing="0" id="bwCurrentRdates"> 1707 <tr> 1708 <th colspan="4">Recurrence Dates</th> 1709 </tr> 1710 <tr> 1711 <td>Date</td> 1712 <td>Time</td> 1713 <td>TZid</td> 1714 <td></td> 1715 </tr> 1716 </table> 1717 1718 <!-- if there are no recurence dates, the following table will show --> 1719 <table cellspacing="0" id="bwCurrentExdatesNone"> 1720 <tr><th>Exception Dates</th></tr> 1721 <tr><td>No exception dates</td></tr> 1722 </table> 1723 1724 <!-- if there are no recurence dates, the following table will show --> 1725 <table cellspacing="0" id="bwCurrentExdates"> 1726 <tr> 1727 <th colspan="4">Exception Dates</th> 1728 </tr> 1729 <tr> 1730 <td>Date</td> 1731 <td>Time</td> 1732 <td>TZid</td> 1733 <td></td> 1734 </tr> 1735 </table> 1736 <p> 1737 Exception dates may also be created by deleting an instance 1738 of a recurring event. 1739 </p> 1611 1740 </div> 1612 1741 </div> trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js
r1245 r1508 1 // Bedework event form functions 2 3 /* ********************************************************************** 4 Copyright 2007 Rensselaer Polytechnic Institute. All worldwide rights reserved. 5 6 Redistribution and use of this distribution in source and binary forms, 7 with or without modification, are permitted provided that: 8 The above copyright notice and this permission notice appear in all 9 copies and supporting documentation; 10 11 The name, identifiers, and trademarks of Rensselaer Polytechnic 12 Institute are not used in advertising or publicity without the 13 express prior written permission of Rensselaer Polytechnic Institute; 14 15 DISCLAIMER: The software is distributed" AS IS" without any express or 16 implied warranty, including but not limited to, any implied warranties 17 of merchantability or fitness for a particular purpose or any warrant)' 18 of non-infringement of any current or pending patent rights. The authors 19 of the software make no representations about the suitability of this 20 software for any particular purpose. The entire risk as to the quality 21 and performance of the software is with the user. Should the software 22 prove defective, the user assumes the cost of all necessary servicing, 23 repair or correction. In particular, neither Rensselaer Polytechnic 24 Institute, nor the authors of the software are liable for any indirect, 25 special, consequential, or incidental damages related to the software, 26 to the maximum extent the law permits. */ 27 1 28 dojo.require("dojo.event.*"); 2 29 dojo.require("dojo.widget.*"); 3 30 dojo.require("dojo.widget.DropdownDatePicker"); 4 31 dojo.require("dojo.widget.DropdownTimePicker"); 32 33 // ======================================================================== 34 // ======================================================================== 35 // Language and customization 36 // These should come from values in the header or included as a separate cutomization 37 // file. 38 39 var rdateDeleteStr = "remove"; 40 41 // ======================================================================== 42 // rdate functions 43 // ======================================================================== 44 45 /* An rdate 46 /* date: String: internal date 47 * time: String 48 * tzid timezone id or null 49 */ 50 function BwREXdate(date, time, allDay, floating, utc, tzid) { 51 this.date = date; 52 this.time = time; 53 this.allDay = allDay; 54 this.floating = floating; 55 this.utc = utc; 56 this.tzid = tzid; 57 58 this.toString = function() { 59 } 60 61 /* row: current table row 62 * rdi: index of rdate fro delete 63 */ 64 this.toFormRow = function(reqPar, row, rdi) { 65 row.insertCell(0).appendChild(document.createTextNode(this.date)); 66 row.insertCell(1).appendChild(document.createTextNode(this.time)); 67 row.insertCell(2).appendChild(document.createTextNode(this.tzid)); 68 row.insertCell(3).innerHTML = "<a href=\"javascript:bwRdates.deleteRdate('" + 69 rdi + "')\">" + rdateDeleteStr + "</a>" + 70 "<input type='hidden' name='" + reqPar + 71 "' value='" + this.format() + "'/>"; 72 } 73 74 this.format= function() { 75 var res = this.date + "\t" + this.time + "\t"; 76 77 if (this.tzid != null) { 78 res += "\t" + this.tzid; 79 } 80 81 return res; 82 } 83 84 this.equals = function(that) { 85 return (that.val = this.val) && (that.tzid = this.tzid); 86 } 87 } 88 89 var bwRdates = new BwREXdates("rdate", "bwCurrentRdates", "bwCurrentRdatesNone", "visible", "invisible", 2); 90 var bwExdates = new BwREXdates("exdate", "bwCurrentExdates", "bwCurrentExdatesNone", "visible", "invisible", 2); 91 92 function BwREXdates(reqPar, tableId, noDatesId, visibleClass, invisibleClass, numHeaderRows) { 93 var rdates = new Array(); 94 95 this.reqPar = reqPar; 96 this.tableId = tableId; 97 98 /* val: String: internal date 99 * dateOnly: boolean 100 * tzid: String or null 101 */ 102 this.addRdate = function(date, time, allDay, floating, utc, tzid) { 103 var newRdate = new BwREXdate(date, time, allDay, floating, utc, tzid); 104 105 if (!this.contains(newRdate)) { 106 rdates.push(newRdate); 107 } 108 } 109 110 this.contains = function(rdate) { 111 for (var j = 0; j < rdates.length; j++) { 112 var curRdate = rdates[j]; 113 if (curRdate.equals(rdate)) { 114 return true; 115 } 116 } 117 118 return false; 119 } 120 121 // Update the list - expects the browser form object 122 this.update = function(date, time, allDay, floating, utc, tzid) { 123 this.addRdate(date, time, allDay, floating, utc, tzid); 124 125 // redraw the display 126 this.display(); 127 } 128 129 this.deleteRdate = function(index) { 130 rdates.splice(index, 1); 131 132 // redraw the display 133 this.display(); 134 } 135 136 // update the rdates table displayed on screen 137 this.display = function() { 138 try { 139 // get the table body 140 var rdTableBody = document.getElementById(this.tableId).tBodies[0]; 141 142 // remove existing rows 143 for (i = rdTableBody.rows.length - 1; i >= 0; i--) { 144 rdTableBody.deleteRow(i); 145 } 146 147 // recreate the table rows 148 for (var j = 0; j < rdates.length; j++) { 149 var curRdate = rdates[j]; 150 var tr = rdTableBody.insertRow(j); 151 152 curRdate.toFormRow(this.reqPar, tr, j); 153 } 154 } catch (e) { 155 alert(e); 156 } 157 } 158 } 159 160 // ======================================================================== 161 // ======================================================================== 5 162 6 163 function setEventFields(formObj) { … … 125 282 if (obj.value == 'true') { 126 283 changeClass('recurrenceFields','visible'); 127 changeClass('rrulesSwitch','visible'); 284 if (document.getElementById('rrulesSwitch')) { 285 changeClass('rrulesSwitch','visible'); 286 } 128 287 } else { 129 288 changeClass('recurrenceFields','invisible'); 130 changeClass('rrulesSwitch','invisible'); 289 if (document.getElementById('rrulesSwitch')) { 290 changeClass('rrulesSwitch','invisible'); 291 } 131 292 } 132 293 } trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl
r1507 r1508 3187 3187 <table cellspacing="0" id="bwCurrentRdates"> 3188 3188 <tr> 3189 <th colspan=" 3">Recurrence Dates</th>3189 <th colspan="4">Recurrence Dates</th> 3190 3190 </tr> 3191 3191 <tr> … … 3199 3199 <!-- if there are no recurence dates, the following table will show --> 3200 3200 <table cellspacing="0" id="bwCurrentExdatesNone"> 3201 <tr><th> RecurrenceDates</th></tr>3202 <tr><td>No recurrencedates</td></tr>3201 <tr><th>Exception Dates</th></tr> 3202 <tr><td>No exception dates</td></tr> 3203 3203 </table> 3204 3204 … … 3206 3206 <table cellspacing="0" id="bwCurrentExdates"> 3207 3207 <tr> 3208 <th colspan=" 3">Exception Dates</th>3208 <th colspan="4">Exception Dates</th> 3209 3209 </tr> 3210 3210 <tr> trunk/deployment/webuser/webapp/resources/demoskins/resources/bedeworkEventForm.js
r1507 r1508 167 167 //setAccessAcl(formObj); 168 168 } 169 170 169 function setDates(formObj) { 171 170 var startDate = new Date(); … … 181 180 formObj["eventEndDate.day"].value = endDate.getDate(); 182 181 } 183 184 182 function swapAllDayEvent(obj) { 185 183 allDayStartDateField = document.getElementById("allDayStartDateField"); … … 234 232 } 235 233 } 236 237 234 function swapRdateAllDay(obj) { 238 235 if (obj.checked) { … … 348 345 } 349 346 } 350 351 347 function recurSelectWeekends(id) { 352 348 chkBoxCollection = document.getElementById(id).getElementsByTagName('input'); … … 363 359 } 364 360 } 365 366 361 function recurSelectWeekdays(id) { 367 362 chkBoxCollection = document.getElementById(id).getElementsByTagName('input'); … … 378 373 } 379 374 } 380 381 375 function selectRecurCountUntil(id) { 382 376 document.getElementById(id).checked = true; 383 377 } 384 385 378 // Assemble the recurrence rules if recurrence is specified. 386 379 // Request params to set ('freq' is always set): … … 481 474 break; 482 475 case "until": 483 // the following will not be adequate for recurrences smaller than a day 476 // the following will not be adequate for recurrences smaller than a day; 484 477 // we will need to set the time properly at that point. 485 478 formObj.until.value = dojo.widget.byId("bwEventWidgetUntilDate").getValue() + "T000000"; … … 521 514 522 515 523
