Changeset 2903
- Timestamp:
- 05/11/10 17:56:21
- Files:
-
- trunk/deployment/webuser/webapp/resources/demoskins/default/default/globals.xsl (modified) (1 diff)
- trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/css/bwScheduling.css (modified) (1 diff)
- trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/eventForm.xsl (modified) (2 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/head.xsl (modified) (2 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkAttendees.js (modified) (1 diff)
- trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkScheduling.js (modified) (10 diffs)
- trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/freebusy.js (added)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/default/default/globals.xsl
r2890 r2903 75 75 <xsl:variable name="delInboxEvent" select="/bedework/urlPrefixes/event/delInboxEvent"/> 76 76 <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/event/addEventRef"/> 77 <xsl:variable name="requestFreeBusy" select="/bedework/urlPrefixes/event/requestFreeBusy"/> 77 78 <!-- locations --> 78 79 <xsl:variable name="location-initAdd" select="/bedework/urlPrefixes/location/initAdd"/> trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/css/bwScheduling.css
r2900 r2903 112 112 } 113 113 #bwScheduleTable td.tentative { 114 background: #eef url(" tentativeLines.gif");114 background: #eef url("../images/tentativeLines.gif"); 115 115 color: black; 116 116 } trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/eventForm.xsl
r2900 r2903 1436 1436 <!-- ======================== --> 1437 1437 <div id="bwEventTab-Scheduling" class="invisible"> 1438 <div id="scheduling"> 1439 <xsl:if test="form/attendees/attendee"> 1440 <xsl:apply-templates select="form/attendees"> 1441 <xsl:with-param name="trash">no</xsl:with-param> 1442 </xsl:apply-templates> 1443 </xsl:if> 1444 <!-- Recipients are deprecated --> 1445 <!-- 1446 <xsl:if test="form/recipients/recipient"> 1447 <xsl:apply-templates select="form/recipients"> 1448 <xsl:with-param name="trash">no</xsl:with-param> 1449 </xsl:apply-templates> 1450 </xsl:if> 1451 --> 1452 <div class="editAttendees"> 1453 <xsl:choose> 1454 <xsl:when test="form/organizerSchedulingObject"> 1455 <input name="editEventAttendees" type="submit" value="{$bwStr-AEEF-EditAttendees}"/> 1456 </xsl:when> 1457 <xsl:when test="form/attendeeSchedulingObject"> 1458 <p> 1459 <em> 1460 <a href="{$schedule-changeStatus}&initUpdate=yes"> 1461 <xsl:copy-of select="$bwStr-AEEF-ChangeMyStatus"/> 1462 </a> 1463 </em> 1464 </p> 1465 </xsl:when> 1466 <xsl:otherwise> 1467 <xsl:choose> 1468 <xsl:when test="form/entityType = '2'"> 1469 <input name="makeEventIntoMeeting" type="submit" value="{$bwStr-AEEF-ScheduleThisTask}"/> 1470 </xsl:when> 1471 <xsl:otherwise> 1472 <input name="makeEventIntoMeeting" type="submit" value="{$bwStr-AEEF-MakeIntoMeeting}"/> 1473 </xsl:otherwise> 1474 </xsl:choose> 1475 </xsl:otherwise> 1476 </xsl:choose> 1438 <!-- 1439 <h4><xsl:copy-of select="$bwStr-Atnd-AddAttendees"/></h4> 1440 <form name="raForm" id="recipientsAndAttendeesForm" action="{$requestFreeBusy}" method="post"> 1441 <div id="raFields"> 1442 <input type="text" name="uri" width="40" id="bwRaUri"/> 1443 <input type="submit" value="{$bwStr-Atnd-Add}" /> 1444 <input type="hidden" name="recipient" value="true"/> 1445 <input type="hidden" name="attendee" value="true"/> 1446 <xsl:text> </xsl:text> 1447 <xsl:copy-of select="$bwStr-Atnd-RoleColon"/> 1448 <select name="role"> 1449 <option value="REQ-PARTICIPANT"><xsl:copy-of select="$bwStr-Atnd-RequiredParticipant"/></option> 1450 <option value="OPT-PARTICIPANT"><xsl:copy-of select="$bwStr-Atnd-OptionalParticipant"/></option> 1451 <option value="CHAIR"><xsl:copy-of select="$bwStr-Atnd-Chair"/></option> 1452 <option value="NON-PARTICIPANT"><xsl:copy-of select="$bwStr-Atnd-NonParticipant"/></option> 1453 </select> 1454 <xsl:text> </xsl:text> 1455 <xsl:copy-of select="$bwStr-Atnd-StatusColon"/> 1456 <select name="partstat"> 1457 <option value="NEEDS-ACTION"><xsl:copy-of select="$bwStr-Atnd-NeedsAction"/></option> 1458 <option value="ACCEPTED"><xsl:copy-of select="$bwStr-Atnd-Accepted"/></option> 1459 <option value="DECLINED"><xsl:copy-of select="$bwStr-Atnd-Declined"/></option> 1460 <option value="TENTATIVE"><xsl:copy-of select="$bwStr-Atnd-Tentative"/></option> 1461 <option value="DELEGATED"><xsl:copy-of select="$bwStr-Atnd-Delegated"/></option> 1462 </select> 1477 1463 </div> 1478 </ div>1479 1464 </form> 1465 --> 1480 1466 1481 1467 <div id="bwSchedule"> … … 1527 1513 </tr> 1528 1514 </table> 1515 <input type="button" id="getJson" onclick="bwGrid.requestFreeBusy('{$resourcesRoot}/javascript/freebusy.js');" value="development: get freebusy"/> 1529 1516 </div> 1530 1517 </div> trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/head.xsl
r2900 r2903 154 154 <link rel="stylesheet" href="{$resourcesRoot}/css/bwScheduling.css"/> 155 155 156 <script type="text/javascript" src="/bedework-common/javascript/jquery/autocomplete/bw-jquery.autocomplete.js"> </script> 157 <script type="text/javascript" src="/bedework-common/javascript/jquery/autocomplete/jquery.bgiframe.min.js"> </script> 158 <script type="text/javascript" src="{$resourcesRoot}/javascript/bedeworkAttendees.js"> </script> 159 <link rel="stylesheet" type="text/css" href="/bedework-common/javascript/jquery/autocomplete/jquery.autocomplete.css" /> 160 156 161 <script type="text/javascript" src="/bedework-common/javascript/bedework/bedeworkAccess.js"> </script> 157 162 <link rel="stylesheet" href="/bedework-common/default/default/bedeworkAccess.css"/> … … 167 172 <xsl:comment> 168 173 // initialize the free/busy grid - values taken directly from the xml 169 // send params: displayId, startRange, endRange, startDate, endDate, startHourRange, endHourRange, attendees, workday, zoom 170 // example: var bwGrid = new bwSchedulingGrid("bwFreeBusyDisplay"," April 21, 2010","April 27, 2010","April 21, 2010 11:00:00","April 21, 2010 11:30:00",8,17,[{name:"Arlen Johnson",uid:"mailto:johnsa@rpi.edu",freebusy:["20100421T093000Z/PT2H00M","20100423T174500Z/PT8H30M"],role:"CHAIR",status:"ACCEPTED",type:"person"}],true,100,"<xsl:value-of select="$resourcesRoot"/>");171 var bwGrid = new bwSchedulingGrid("bwFreeBusyDisplay"," April 21, 2010","April 27, 2010","April 21, 2010 11:00:00","April 21, 2010 11:30:00",8,17,[],true,100,"<xsl:value-of select="$resourcesRoot"/>");174 // send params: displayId, startRange, endRange, startDate, endDate, startHourRange, endHourRange, attendees, workday, zoom, browserResourcesRoot, fbUrl, organizerUri 175 // example: var bwGrid = new bwSchedulingGrid("bwFreeBusyDisplay","May 5, 2010","May 17, 2010","May 10, 2010 11:00:00","May 10, 2010 11:30:00",8,17,[{name:"Arlen Johnson",uid:"mailto:johnsa@rpi.edu",role:"CHAIR",status:"ACCEPTED",type:"person"}],true,100,"<xsl:value-of select="$resourcesRoot"/>","<xsl:value-of select="$requestFreeBusy"/>",""); 176 var bwGrid = new bwSchedulingGrid("bwFreeBusyDisplay","May 5, 2010","May 17, 2010","May 10, 2010 11:00:00","May 10, 2010 11:30:00",8,17,[],true,100,"<xsl:value-of select="$resourcesRoot"/>","<xsl:value-of select="$resourcesRoot"/>/javascript/freebusy.js",""); 172 177 173 178 // send in some attendees - these will come from interaction with the form 174 bwGrid.updateAttendee("Arlen Johnson", "mailto:johnsa@rpi.edu", ["20100421T093000Z/PT2H00M","20100423T174500Z/PT8H30M"], "CHAIR", "ACCEPTED", "person"); 175 bwGrid.updateAttendee("Gary Schwartz", "mailto:schwag@rpi.edu", ["20100422T090000Z/PT1H00M"], "REQ-PARTICIPANT", "NEEDS-ACTION"); 176 bwGrid.updateAttendee("", "mailto:douglm@rpi.edu", ["FBTYPE=BUSY-TENTATIVE:20100421T120000Z/20100421T130000Z","20100422T050000Z/20100422T060000Z"], "OPT-PARTICIPANT", "DECLINED"); 179 bwGrid.updateAttendee("Arlen Johnson", "mailto:johnsa@mysite.edu", "CHAIR", "ACCEPTED", "person"); 180 bwGrid.updateAttendee("Gary Schwartz", "mailto:schwag@mysite.edu", "REQ-PARTICIPANT", "NEEDS-ACTION"); 181 bwGrid.updateAttendee("", "mailto:douglm@mysite.edu", "OPT-PARTICIPANT", "DECLINED"); 182 183 // now initialize the grid 184 bwGrid.init(); 177 185 </xsl:comment> 178 186 </script> trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkAttendees.js
r2893 r2903 59 59 }, 60 60 formatResult: function(item) { 61 alert("here!"); 61 62 return item.email; 62 63 } trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkScheduling.js
r2900 r2903 66 66 * name: String - name of attendee, e.g. "Venerable Bede" 67 67 * uid: String - attendee's uid with mailto included, e.g. "mailto:vbede@example.com" 68 * freebusyStrings: Array of rfc5545 freebusy reply values for the current attendee in the current date range69 68 * role: String - Attendee role, e.g. CHAIR, REQ-PARTICIPANT, etc 70 69 * status: String - participation status (PARTSTAT) … … 72 71 * selected: Boolean - if attendee is included in picknext selections (checkbox next to attendee in grid) 73 72 */ 74 var bwAttendee = function(name, uid, freebusyStrings,role, status, type) {73 var bwAttendee = function(name, uid, role, status, type) { 75 74 this.name = name; 76 75 this.uid = uid; … … 81 80 this.selected = true; 82 81 83 //populate the freebusy objects 84 for (i = 0; i<freebusyStrings.length; i++) { 85 var fb = new bwFreeBusy(freebusyStrings[i]); 86 this.freebusy.push(fb); 87 } 88 82 // set the default type if needed 89 83 if (this.type == null || this.type == "") { 90 84 this.type == bwAttendeeTypePerson; 91 85 } 86 87 // function to populate the freebusy objects 88 // freebusyStrings: Array of rfc5545 freebusy reply values for the current attendee in the current date range 89 this.updateFreeBusy = function(fbStrings) { 90 // empty the freebusy array (to refresh on updates) 91 this.freebusy.length = 0; 92 // push the new freebusy strings into the array 93 for (i = 0; i<fbStrings.length; i++) { 94 var fb = new bwFreeBusy(fbStrings[i]); 95 this.freebusy.push(fb); 96 } 97 } 92 98 } 99 93 100 /* A Freebusy object 94 101 * Provides methods to work on freebusy values … … 165 172 * workday: boolean - true to display workday hours only, false to display all 24 hours 166 173 * zoom: integer - scalar value for zooming the grid 174 * browserResourcesRoot: string - URL of browser resources (for displaying images, etc) 175 * fbUrl: string - URL for making freebusy requests 176 * organizerUri string - e.g. "someone@mysite.edu" 167 177 */ 168 var bwSchedulingGrid = function(displayId, startRange, endRange, startDate, endDate, startHoursRange, endHoursRange, attendees, workday, zoom, browserResourcesRoot ) {178 var bwSchedulingGrid = function(displayId, startRange, endRange, startDate, endDate, startHoursRange, endHoursRange, attendees, workday, zoom, browserResourcesRoot, fbUrl, organizerUri) { 169 179 this.displayId = displayId; 170 180 this.startRange = new Date(startRange); … … 178 188 this.attendees = new Array(); // array of bwAttendee objects 179 189 this.resourcesRoot = browserResourcesRoot; 190 this.fbUrl = fbUrl; 191 this.organizer = organizerUri; 180 192 181 193 // 2D array of time and busy state for all attendees … … 187 199 this.freeTimeIndex = 0; 188 200 189 // initialize any incoming attendees on first load190 for (i = 0; i < attendees.length; i++) {191 var newAttendee = new bwAttendee(attendees[i].name,attendees[i].uid ,attendees[i].freebusy,attendees[i].role,attendees[i].status,attendees[i].type);192 this.attendees.push(newAttendee);193 }194 195 201 // how much will we divide the hour in the grid? 196 202 // ALWAYS set as a factor of 60 and never below 1 … … 214 220 var pickNextClicked = false; // false until the first time we click "pick next" - allows us to show the first free time window on first click 215 221 216 217 this.updateAttendee = function(name, uid, freebusy, role, status, type) { 218 var newAttendee = new bwAttendee(name, uid, freebusy, role, status, type); 219 /*var attendeeIsNew = true; 222 223 // initialize the grid 224 this.init = function() { 225 // initialize any incoming attendees on first load 226 // while iterating, build up the array of requests 227 for (i = 0; i < attendees.length; i++) { 228 var newAttendee = new bwAttendee(attendees[i].name,attendees[i].uid, attendees[i].role,attendees[i].status,attendees[i].type); 229 this.attendees.push(newAttendee); 230 } 231 232 // now go get the freebusy information for the attendees 233 this.requestFreeBusy(this.fbUrl); 234 } 235 236 // add/update attendees 237 /* examples: 238 bwGrid.updateAttendee("Venerable Bede", "mailto:vbede@mysite.edu", ["20100421T093000Z/PT2H00M","20100423T174500Z/PT8H30M"], "CHAIR", "ACCEPTED", "person"); 239 bwGrid.updateAttendee("Samual Clemens", "mailto:sclemens@mysite.edu", ["20100422T090000Z/PT1H00M"], "REQ-PARTICIPANT", "NEEDS-ACTION"); 240 bwGrid.updateAttendee("", "mailto:noname@mysite.edu", ["FBTYPE=BUSY-TENTATIVE:20100421T120000Z/20100421T130000Z","20100422T050000Z/20100422T060000Z"], "OPT-PARTICIPANT", "DECLINED"); 241 */ 242 this.updateAttendee = function(name, uid, role, status, type) { 243 var newAttendee = new bwAttendee(name, uid, role, status, type); 244 var attendeeIsNew = true; 220 245 221 246 // check to see if attendee already exists 222 247 for (i=0; i < this.attendees.length; i++) { 223 alert(newAttendee.uid + " -- " +attendees[i].uid);224 if (newAttendee.uid == attendees[i].uid) {248 //alert(newAttendee.uid + " -- " + this.attendees[i].uid); 249 if (newAttendee.uid == this.attendees[i].uid) { 225 250 attendeeIsNew = false; 226 251 break; … … 228 253 } 229 254 230 if (attendeeIsNew) { */255 if (attendeeIsNew) { 231 256 this.attendees.push(newAttendee); 232 //}257 } 233 258 234 259 this.display(); … … 237 262 this.removeAttendee = function(index) { 238 263 this.attendees.splice(index, 1); 264 this.display(); 265 } 266 267 this.requestFreeBusy = function(fburl) { 268 $.getJSON(fburl, function(fb) { 269 for (i=0; i < fb.microformats["schedule-response"].length; i++) { 270 var r = fb.microformats["schedule-response"][i]; // reference the current response 271 272 // prepare the freebusy strings for the attendee 273 var fbStrings = new Array(); 274 for (j=0; j < r["calendar-data"].freebusy.periods.length; j++) { 275 fbStrings[j] = r["calendar-data"].freebusy.periods[j].value; 276 } 277 278 // find the attendee and update freebusy 279 for (j=0; j < bwGrid.attendees.length; j++) { 280 //alert(r["calendar-data"].attendee[0].value + " : " + bwGrid.attendees[j].uid); 281 if (r["calendar-data"].attendee[0].value == bwGrid.attendees[j].uid) { 282 bwGrid.attendees[j].updateFreeBusy(fbStrings); 283 } 284 } 285 } 286 }); 239 287 this.display(); 240 288 } … … 743 791 } 744 792 745 746 793 // Utilities 747 794 var dayRange = function(startDate, endDate) { 748 795 // find difference in milliseconds and return number of days.
