Changeset 2953

Show
Ignore:
Timestamp:
07/13/10 19:44:19
Author:
johnsa
Message:

user client: numerous scheduling UI updates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/css/bwScheduling.css

    r2951 r2953  
    8383#bwScheduleTable #bwAddAttendee { 
    8484  cursor: pointer; 
    85   padding: 4px 0; 
     85  margin: 4px 0; 
    8686} 
    8787#bwScheduleTable #bwAddAttendee.pending { 
     
    9393  color: black; 
    9494  background-color: transparent; 
    95   border: none
     95  border: 1px solid #ddd
    9696} 
    9797#bwScheduleTable #bwAddAttendeeAdvanced { 
     
    107107  cursor: pointer; 
    108108} 
     109#bwScheduleTable #bwAddAttendeeFields { 
     110        margin: auto; 
     111        width: 170px; 
     112} 
     113#bwScheduleTable .bwAddAttendeeSubField { 
     114        float: left; 
     115        font-size: 0.9em; 
     116  margin: 0.5em 0.25em; 
     117} 
     118#bwScheduleTable .bwAddAttendeeSubFieldHead { 
     119  text-align: center; 
     120  background-color: #eee; 
     121  color: black; 
     122} 
    109123#bwScheduleTable #attType { 
    110124  display: none; 
     
    117131} 
    118132#bwScheduleTable td.busy { 
    119   background-color: #b1cbfa
     133  background-color: #b1cbfa !important
    120134  color: black; 
    121135} 
     
    125139}  
    126140#bwScheduleTable td.tentative { 
    127   background: #eef url("../images/tentativeLines.gif")
     141  background: #eef url("../images/tentativeLines.gif") !important
    128142  color: black; 
    129143} 
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/eventForm.xsl

    r2928 r2953  
    15621562      <!-- the following test on the organizerSchedulingObject is not good - will need to fix --> 
    15631563      <xsl:when test="scheduleMethod = '2' and organizerSchedulingObject"> 
    1564         <input name="submitAndSend" type="submit" value="{$bwStr-AEEF-SaveAndSendInvites}"/> 
     1564        <input name="submitAndSend" type="submit" value="{$bwStr-AEEF-SaveAndSendInvites}" class="bwEventFormSubmit"/> 
    15651565        <!-- dissalow: at the moment there's no way to send invitations after the first save 
    15661566        <input name="submit" type="submit" value="{$bwStr-AEEF-SaveDraft}"/> --> 
    15671567      </xsl:when> 
    15681568      <xsl:otherwise> 
    1569         <input name="submit" type="submit" value="{$bwStr-AEEF-Save}"/> 
     1569        <input name="submit" type="submit" value="{$bwStr-AEEF-Save}" class="bwEventFormSubmit"/> 
    15701570      </xsl:otherwise> 
    15711571    </xsl:choose> 
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkAttendees.js

    r2950 r2953  
    2727    format: 'json', 
    2828    addrbook: '/public/locations' 
     29    //addrbook: '/user/johnsa/addressbook' 
    2930  }, 
    3031 
     
    3839    data = data.microformats.vcard; 
    3940    for (var i = 0; i < data.length; i++) { 
    40       dataRow = { 
    41         fn: (data[i].fn.value)?data[i].fn.value:"", 
    42         email: (data[i].email[0].value)?data[i].email[0].value:"", 
    43         uri: (data[i].caladruri.value)?data[i].caladruri.value:"", 
    44         type: (data[i].kind.value)?data[i].kind.value:"" 
    45       }; 
    46       parsed[i] = { 
    47         data: dataRow, 
    48         value: data[i].fn.value, 
    49         result: data[i].email[0].value 
    50       }; 
     41       
     42      // pick out the best uri if one is available 
     43      // caladruri is first choice, email second 
     44      var cururi = ""; 
     45      if (data[i].caladruri != undefined && data[i].caladruri.value != undefined) { 
     46        cururi = data[i].caladruri.value; 
     47      } 
     48      if (cururi == "" && data[i].email[0] != undefined && data[i].email[0].value != undefined) { 
     49        var curEmail = data[i].email[0].value; 
     50        if (curEmail != "") { 
     51          cururi = "mailto:" + curEmail; 
     52        } 
     53      }       
     54      // check for the existence of fn 
     55      var curfn = ""; 
     56      if (data[i].fn != undefined && data[i].fn.value != undefined) { 
     57        curfn = data[i].fn.value; 
     58      } 
     59       
     60      // check for the existence of kind 
     61      var curkind = ""; 
     62      if (data[i].kind != undefined && data[i].kind.value != undefined) { 
     63        curkind = data[i].kind.value; 
     64      } 
     65       
     66      // skip if no uri  
     67      if (cururi != "") { 
     68        dataRow = { 
     69          fn: curfn, 
     70          uri: cururi,  
     71          type: curkind 
     72        }; 
     73        parsed[i] = { 
     74          data: dataRow, 
     75          value: curfn, 
     76          result: cururi 
     77        }; 
     78      } 
    5179    } 
    5280    return parsed; 
    5381  }, 
    5482  formatItem: function(item) { 
    55       return " \"" + item.fn + "\" [" + item.email + "]"; 
     83      return " \"" + item.fn + "\" [" + item.uri.substring(7) + "]"; 
    5684  }, 
    5785 
    5886  formatMatch: function(item) { 
    59       return " \"" + item.fn + "\" [" + item.email + "]"; 
     87      return " \"" + item.fn + "\" [" + item.uri.substring(7) + "]"; 
    6088  }, 
    6189  formatResult: function(item) { 
    62     return item.email
     90    return item.uri
    6391  } 
    6492}; 
    65  
    66 // carddavUrl supplied in bedework.js 
    67 jQuery(document).ready(function($) { 
    68   $('#bwAddAttendee').autocomplete(carddavUrl, bwAutoCompleteOptions) 
    69 }); 
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkScheduling.js

    r2952 r2953  
    6363var bwAddDisp = "add"; 
    6464var bwAttendeeExistsDisp = "attendee exists"; 
     65var bwAddAttendeeRoleDisp = "Role:"; 
     66var bwAddAttendeeTypeDisp = "Type"; 
     67var bwAddAttendeeBookDisp = "Book"; 
     68var bwEventSubmitMeetingDisp = "send"; 
    6569 
    6670var bwReqParticipantDisp = "required"; 
     
    220224  // times to be displayed, e.g. hourDivision = 4 quantizes the  
    221225  // display to 15 minute increments; hourDivision = 1 locks the events to the 
    222   // nearest hour (not a good outcome
     226  // nearest hour (which is likely not best
    223227  // 4, 6, or 12 is preferred (and higher begins to slow down the display) 
    224228  // If in doubt, leave this at 4 
     
    228232  var hourMils = 3600000; 
    229233  var startMils = Number(this.startRange.getTime()) + Number(this.startHoursRange * hourMils); // the start of the grid 
    230   var durationMils = hourMils; // value used to calculate default endSelectionMils, defaults to 1 hour in milliseconds  
     234  var durationMils = hourMils; // value used to calculate default endSelectionMils, defaults to 1 hour in milliseconds 
     235                               // - SHOULD DEFAULT TO DATE/TIME SETTINGS 
    231236  var incrementMils = hourMils / this.hourDivision; // increment for the pick next/previous buttons 
    232237  var startSelectionMils = startMils;  // where a mouse selection begins, milliseconds parsed from the first half of a fbcell's ID, default to beginning of grid 
     238                                       // - SHOULD DEFAULT TO DATE/TIME SETTINGS 
    233239  var endSelectionMils;       // where a mouse selection ends, milliseconds parsed from the first half of a fbcell's ID 
    234240  var selecting = false;      // are we currently selecting?  If true, we'll highlight as we hover 
     
    270276    $("#bwSchedProcessingMsg").show(); 
    271277     
    272     //var showAtts = ""; 
    273278    // check to see if attendee already exists 
    274279    for (var i=0; i < bwGrid.attendees.length; i++) { 
    275       //showAtts += bwGrid.attendees[i].uid + "\n"; 
     280      if (uid.indexOf("mailto:") != -1) { 
     281         uid = uid.substring(7);  
     282      } 
    276283      if (uid == bwGrid.attendees[i].uid) { 
    277284        attendeeIsNew = false; 
     
    282289      }  
    283290    } 
    284     //alert(showAtts); 
    285291     
    286292    if (attendeeIsNew) { 
     
    289295        type: "POST", 
    290296        url: bwGrid.attUrlPrefix, 
    291         data: "uri=" + uid + "&role=" + role + "&partstat=" + status + "&attendee=true&submit=add", 
     297        data: "uri=" + uid + "&role=" + role + "&partstat=" + status + "&attendee=true&submit=add&list=yes", 
    292298        success: function(){ 
    293299          // add the attendee to the local array 
    294300          // this data must be completed by the ajax call (coming) 
     301         
     302          // take off "mailto:" for local storage 
     303          if (uid.indexOf("mailto:") != -1) { 
     304             uid = uid.substring(7);  
     305          } 
    295306          var newAttendee = new bwAttendee(name, uid, role, status, type); 
    296307          bwGrid.attendees.push(newAttendee);  
    297308          bwGrid.requestFreeBusy(); 
     309           
     310          // got attendees??  send the param that will trigger a 
     311          // scheduling request. For now, just set this every time 
     312          // (we'll trim back later) 
     313          if (bwGrid.attendees.length) { 
     314            $("input.bwEventFormSubmit").each(function(i) { 
     315               $(this).attr("name","submitAndSend"); 
     316               $(this).val(bwEventSubmitMeetingDisp); 
     317            }); 
     318          } 
    298319        }, 
    299320        error: function(msg) { 
     
    387408     
    388409    // now do the highlighting 
     410    bwGrid.highlight(curSelectionTime, endSelectionMils); 
     411     
     412    // we've clicked pickedNext - so set the pickNextClicked flag to true 
     413    // this flag lets us highlight the very first free time window on first click 
     414    pickNextClicked = true; 
     415     
     416    bwGrid.setDateTimeWidgets(curSelectionTime); 
     417  }; 
     418   
     419  this.pickPrevious = function() { 
     420    // clear highlighting 
     421    $("#bwScheduleTable .fbcell").removeClass("highlight"); 
     422     
     423    // go to the previous freeTime if available and highlight it 
     424    if (this.freeTimeIndex > 0) { 
     425      this.freeTimeIndex -= 1; 
     426    } 
     427    // set the start of the selection range using the freeTimeIndex 
     428    var curSelectionTime = Number(this.freeTime[this.freeTimeIndex]); 
     429    // set the end time by adding the duration 
     430    endSelectionMils = Number(curSelectionTime) + Number(durationMils); 
     431 
     432    // now do the highlighting 
     433    bwGrid.highlight(curSelectionTime, endSelectionMils); 
     434         
     435    bwGrid.setDateTimeWidgets(curSelectionTime); 
     436  }; 
     437   
     438  this.highlight = function (curSelectionTime, endSelectionMils) { 
    389439    $("#bwScheduleTable .fbcell").each(function(index) { 
    390440      var splId = $(this).attr("id").split("-"); 
     
    392442        $(this).addClass("highlight"); 
    393443      } 
    394        
    395444    }); 
    396      
    397     // we've clicked pickedNext - so set the pickNextClicked flag to true 
    398     // this flag lets us highlight the very first free time window on first click 
    399     pickNextClicked = true; 
    400      
    401     bwGrid.setDateTimeWidgets(curSelectionTime); 
    402   }; 
    403    
    404   this.pickPrevious = function() { 
    405     // clear highlighting 
    406     $("#bwScheduleTable .fbcell").removeClass("highlight"); 
    407      
    408     // go to the previous freeTime if available and highlight it 
    409     if (this.freeTimeIndex > 0) { 
    410       this.freeTimeIndex -= 1; 
    411     } 
    412     // set the start of the selection range using the freeTimeIndex 
    413     var curSelectionTime = Number(this.freeTime[this.freeTimeIndex]); 
    414     // set the end time by adding the duration 
    415     endSelectionMils = Number(curSelectionTime) + Number(durationMils); 
    416      
    417     // now do the highlighting 
    418     $("#bwScheduleTable .fbcell").each(function(index) { 
    419       var splId = $(this).attr("id").split("-"); 
    420       if (splId[0] >= curSelectionTime && splId[0] < endSelectionMils) { 
    421         $(this).addClass("highlight"); 
    422       } 
    423     }); 
    424      
    425     bwGrid.setDateTimeWidgets(curSelectionTime); 
    426445  }; 
    427446   
     
    589608          // this is where we could use zoom to increase or decrease tick marks and time labels on the grid 
    590609          if (this.zoom == 100) { 
    591             $(fbDisplayTimesRow).append('<td class="hourBoundry" id="' + curDate.getTime() + '-TimeRow" colspan="' + this.hourDivision + '">' + curDate.getHours12() + ':' + curDate.getMinutesFull() + '</td>'); 
     610            $(fbDisplayTimesRow).append('<td class="hourBoundry timeCell" id="' + curDate.getTime() + '-TimeRow" colspan="' + this.hourDivision + '">' + curDate.getHours12() + ':' + curDate.getMinutesFull() + '</td>'); 
    592611            curDate.addHours(1); 
    593612          } 
     
    766785      // create the add attendee form  
    767786      var addAttendeeHtml = '<td class="addAttendee" colspan="4">'; 
    768       addAttendeeHtml += '<input type="text" value="' + bwAddAttendeeDisp +'" name="attendee" id="bwAddAttendee" class="pending" size="30"/>'; 
     787      addAttendeeHtml += '<input type="text" value="' + bwAddAttendeeDisp +'" name="q" id="bwAddAttendee" class="pending" size="30"/>'; 
    769788      addAttendeeHtml += '<span id="bwAddAttendeeAdd" class="invisible">' + bwAddDisp +'</span>'; 
    770789      //addAttendeeHtml += '<span id="bwAddAttendeeAdvanced">advanced</span>'; 
    771790      addAttendeeHtml += '<div id="bwAddAttendeeFields" class="invisible">'; 
    772       addAttendeeHtml += '<select name="role" id="bwAddAttendeeRole">'; 
    773       addAttendeeHtml += '  <option value="REQ-PARTICIPANT">' + bwReqParticipantDisp + '</option>'; 
    774       addAttendeeHtml += '  <option value="OPT-PARTICIPANT">' + bwOptParticipantDisp + '</option>'; 
    775       addAttendeeHtml += '  <option value="CHAIR">' + bwChairDisp + '</option>'; 
    776       addAttendeeHtml += '  <option value="NON-PARTICIPANT">' + bwNonParticipant + '</option>'; 
    777       addAttendeeHtml += '</select>'; 
    778       addAttendeeHtml += '<select name="partstat" id="bwAddAttendeePartstat">'; 
    779       addAttendeeHtml += '  <option value="NEEDS-ACTION">' + bwNeedsAction + '</option>'; 
    780       addAttendeeHtml += '  <option value="ACCEPTED">' + bwAccepted + '</option>'; 
    781       addAttendeeHtml += '  <option value="DECLINED">' + bwDeclined + '</option>'; 
    782       addAttendeeHtml += '  <option value="TENTATIVE">' + bwTentative + '</option>'; 
    783       addAttendeeHtml += '  <option value="DELEGATED">' + bwDelegated + '</option>'; 
    784       addAttendeeHtml += '</select>'; 
    785       //addAttendeeHtml += '<select><option>person</option><option>group</option><option>resource</option></select>'; 
    786       //addAttendeeHtml += '<input type="checkbox"/>personal <input type="checkbox"/>public'; 
     791      addAttendeeHtml += '  ' + bwAddAttendeeRoleDisp + ' '; 
     792      addAttendeeHtml += '  <select name="role" id="bwAddAttendeeRole">'; 
     793      addAttendeeHtml += '    <option value="REQ-PARTICIPANT">' + bwReqParticipantDisp + '</option>'; 
     794      addAttendeeHtml += '    <option value="OPT-PARTICIPANT">' + bwOptParticipantDisp + '</option>'; 
     795      addAttendeeHtml += '    <option value="CHAIR">' + bwChairDisp + '</option>'; 
     796      addAttendeeHtml += '    <option value="NON-PARTICIPANT">' + bwNonParticipant + '</option>'; 
     797      addAttendeeHtml += '  </select>'; 
     798      // DON'T include partstat except for testing.  This value should be determined by actual participants. 
     799      //addAttendeeHtml += '<select name="partstat" id="bwAddAttendeePartstat">'; 
     800      //addAttendeeHtml += '  <option value="NEEDS-ACTION">' + bwNeedsAction + '</option>'; 
     801      //addAttendeeHtml += '  <option value="ACCEPTED">' + bwAccepted + '</option>'; 
     802      //addAttendeeHtml += '  <option value="DECLINED">' + bwDeclined + '</option>'; 
     803      //addAttendeeHtml += '  <option value="TENTATIVE">' + bwTentative + '</option>'; 
     804      //addAttendeeHtml += '  <option value="DELEGATED">' + bwDelegated + '</option>'; 
     805      //addAttendeeHtml += '</select>'; 
     806      addAttendeeHtml += '  <div class="bwAddAttendeeSubField">'; 
     807      addAttendeeHtml += '    <div class="bwAddAttendeeSubFieldHead">' + bwAddAttendeeTypeDisp + '</div>'; 
     808      addAttendeeHtml += '    <input type="radio" name="bwAddAttendeeType" value="person" checked="checked">person<br/>'; 
     809      addAttendeeHtml += '    <input type="radio" name="bwAddAttendeeType" value="group" disabled="disabled">group<br/>'; 
     810      addAttendeeHtml += '    <input type="radio" name="bwAddAttendeeType" value="location"/>location'; 
     811      addAttendeeHtml += '  </div>'; 
     812      addAttendeeHtml += '  <div class="bwAddAttendeeSubField">'; 
     813      addAttendeeHtml += '    <div class="bwAddAttendeeSubFieldHead">' + bwAddAttendeeBookDisp + '</div>'; 
     814      addAttendeeHtml += '    <input type="radio" name="bwAddAttendeeAddrBk" value="person" checked="checked">personal<br/>'; 
     815      addAttendeeHtml += '    <input type="radio" name="bwAddAttendeeAddrBk" value="group">public<br/>'; 
     816      addAttendeeHtml += '  </div>'; 
    787817      addAttendeeHtml += '</div>'; 
    788818      addAttendeeHtml += '</td><td class="fbBoundry"></td>'; 
     
    841871      // write the table back to the display 
    842872      $("#" + displayId).html(fbDisplay); 
     873       
     874       
     875      // highlight the time based on the current date/time settings 
     876      //var curSelectionTime = Number(startSelectionMils); 
     877      // set the end time by adding the duration 
     878      //endSelectionMils = Number(curSelectionTime) + Number(durationMils); 
     879      //bwGrid.highlight(curSelectionTime, endSelectionMils); 
    843880       
    844881       
     
    10071044      ); 
    10081045       
     1046      // auto-completion for add attendee input field  
     1047      // carddavUrl supplied in bedework.js 
     1048       var carddavUrlTemp = "/ucalrsrc/themes/bedeworkTheme/javascript/addrbookUsers.js" 
     1049       //var carddavUrlTemp = "/ucalrsrc/themes/bedeworkTheme/javascript/addrbookLocations.js" 
     1050      $("#bwScheduleTable #bwAddAttendee").autocomplete(carddavUrlTemp, bwAutoCompleteOptions); 
     1051       
    10091052      // capture the enter key when entering an attendee; 
    10101053      // do not submit the form; add the attendee.