Changeset 2879

Show
Ignore:
Timestamp:
04/23/10 11:42:51
Author:
johnsa
Message:

ongoing update to free/busy mockup

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/bedeworkFb.js

    r2878 r2879  
    9292 * zoom:            integer - scalar value for zooming the grid 
    9393 */ 
    94 var bwFreeBusy = function(displayId, startRange, endRange, startDate, endDate, startHoursRange, endHoursRange, attendees, workday, zoom) { 
     94var bwSchedulingGrid = function(displayId, startRange, endRange, startDate, endDate, startHoursRange, endHoursRange, attendees, workday, zoom) { 
    9595  this.displayId = displayId; 
    9696  this.startRange = new Date(startRange); 
     
    170170        for (j = 0; j < hourRange; j++) { 
    171171          for (k = 0; k < this.hourDivision; k++) { 
     172            var fbCell = document.createElement("td"); 
     173            fbCell.id = curDate.getTime() + "-AllAttendees"; 
     174            $(fbCell).addClass("fbcell"); 
    172175            if (curDate.getMinutes() == 0) { 
    173               $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="hourBoundry fbcell"></td>'); 
    174             } else { 
    175               $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="fbcell"></td>'); 
    176             } 
     176              $(fbCell).addClass("hourBoundry"); 
     177            }  
     178            $(fbDisplayTimesRow).append(fbCell); 
    177179            curDate.addMinutes(60/this.hourDivision); 
    178180          } 
     
    225227            $(fbDisplayTimesRow).append('<td class="role optional"><span class="icon">&#160;</span><span class="text">' + bwAttendeeDispRoleOptional + '</span></td>'); 
    226228        } 
    227         $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>'); 
     229         
     230        // output the attendee name or address (depending on which we have available) 
     231        if (curAttendee.name && curAttendee.name != "") { 
     232          $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.name + '</td><td class="fbBoundry"></td>'); 
     233        } else { 
     234          $(fbDisplayTimesRow).append('<td class="name">' + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1) + '</td><td class="fbBoundry"></td>'); 
     235        } 
     236         
     237        // build the time row for an attendee 
    228238        for (i = 0; i < range; i++) { 
    229239          var curDate = new Date(this.startRange); 
     
    233243          for (j = 0; j < hourRange; j++) { 
    234244            for (k = 0; k < this.hourDivision; k++) { 
     245              var fbCell = document.createElement("td"); 
     246              fbCell.id = curDate.getTime() + "-" + curAttendee.uid.substr(curAttendee.uid.lastIndexOf(":")+1); 
     247              $(fbCell).addClass("fbcell"); 
    235248              if (curDate.getMinutes() == 0) { 
    236                 $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees" class="hourBoundry"></td>'); 
    237               } else { 
    238                 $(fbDisplayTimesRow).append('<td id="' + curDate.getTime() + '-AllAttendees fbcell"></td>'); 
    239               } 
    240               // increment by the number of minutes in the hour division 
    241               curDate.addMinutes(60 / this.hourDivision); 
     249                $(fbCell).addClass("hourBoundry"); 
     250              }  
     251              //switch (bwFreeBusycurDate.getTime()) 
     252              $(fbDisplayTimesRow).append(fbCell); 
     253              curDate.addMinutes(60/this.hourDivision); 
    242254            } 
    243255          } 
     
    245257        } 
    246258      } 
     259       
     260      //  
    247261       
    248262      // finally, write the table back to the display 
     
    312326 
    313327/* 
    314  
    315  
    316  
     328 * From RFC 5545 
    317329 * The following is an example of a "VFREEBUSY" calendar component 
    318  
    319  
    320  
    321330 used to reply to the request with busy time information: 
    322  
    323  
    324  
     331  
    325332 BEGIN:VFREEBUSY 
    326  
    327  
    328  
    329333 UID:19970901T095957Z-76A912@example.com 
    330  
    331  
    332  
    333334 ORGANIZER:mailto:jane_doe@example.com 
    334  
    335  
    336  
    337335 ATTENDEE:mailto:john_public@example.com 
    338  
    339  
    340  
    341336 DTSTAMP:19970901T100000Z 
    342  
    343  
    344  
    345337 FREEBUSY:19971015T050000Z/PT8H30M, 
    346  
    347  
    348  
    349338 19971015T160000Z/PT5H30M,19971015T223000Z/PT6H30M 
    350  
    351  
    352  
    353339 URL:http://example.com/pub/busy/jpublic-01.ifb 
    354  
    355  
    356  
    357340 COMMENT:This iCalendar file contains busy time information for 
    358  
    359  
    360  
    361341 the next three months. 
    362  
    363  
    364  
    365342 END:VFREEBUSY 
    366343 
    367  
    368  
    369344 The following is an example of a "VFREEBUSY" calendar component 
    370  
    371  
    372  
    373345 used to publish busy time information: 
    374346 
    375  
    376  
    377347 BEGIN:VFREEBUSY 
    378  
    379  
    380  
    381348 UID:19970901T115957Z-76A912@example.com 
    382  
    383  
    384  
    385349 DTSTAMP:19970901T120000Z 
    386  
    387  
    388  
    389350 ORGANIZER:jsmith@example.com 
    390  
    391  
    392  
    393351 DTSTART:19980313T141711Z 
    394  
    395  
    396  
    397352 DTEND:19980410T141711Z 
    398  
    399  
    400  
    401353 FREEBUSY:19980314T233000Z/19980315T003000Z 
    402  
    403  
    404  
    405354 FREEBUSY:19980316T153000Z/19980316T163000Z 
    406  
    407  
    408  
    409355 FREEBUSY:19980318T030000Z/19980318T040000Z 
    410  
    411  
    412  
    413356 URL:http://www.example.com/calendar/busytime/jsmith.ifb 
    414  
    415  
    416  
    417357 END:VFREEBUSY 
    418  
    419  
    420  
    421358 * 
    422  
    423  
    424  
    425359 */ 
    426  
    427  
    428  
  • trunk/deployment/webuser/webapp/resources/demoskins/fbMockup/index.html

    r2875 r2879  
    1818      // initialize the free/busy grid - values taken directly from the xml 
    1919      // send params: displayId, startRange, endRange, startDate, endDate, attendees, workday, zoom 
    20       var fbGrid = new bwFreeBusy("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:[],role:"CHAIR",status:"ACCEPTED",type:"person"}],true,100); 
     20      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:["20100421T050000Z/PT2H00M","20100423T050000Z/PT8H30M"],role:"CHAIR",status:"ACCEPTED",type:"person"}],true,100); 
    2121       
    2222      // send in some attendees - these will come from interaction with the form 
    23       fbGrid.addAttendee("Gary Schwartz", "mailto:schwag@rpi.edu", [], "REQ-PARTICIPANT", "NEEDS-ACTION"); 
    24       fbGrid.addAttendee("Mike Douglass", "mailto:douglm@rpi.edu", [], "OPT-PARTICIPANT", "DECLINED"); 
    25  
    26        
     23      bwGrid.addAttendee("Gary Schwartz", "mailto:schwag@rpi.edu", ["20100422T050000Z/PT1H00M"], "REQ-PARTICIPANT", "NEEDS-ACTION"); 
     24      bwGrid.addAttendee("", "mailto:douglm@rpi.edu", ["20100421T120000Z/20100421T130000Z","20100421T050000Z/20100422T050000Z"], "OPT-PARTICIPANT", "DECLINED"); 
    2725 
    2826      // set datepicker defaults 
     
    5048     
    5149        // buld the free/busy grid 
    52         fbGrid.display(); 
     50        bwGrid.display(); 
    5351         
    5452      });