Changeset 2942

Show
Ignore:
Timestamp:
07/01/10 16:43:34
Author:
johnsa
Message:

user client: scheduling - load attendees into scheduling grid when editing; remove attendees working.

Files:

Legend:

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

    r2896 r2942  
    2222  xmlns="http://www.w3.org/1999/xhtml"> 
    2323   
    24     <xsl:template name="attendees"> 
     24  <!-- transform the attendees into an array of json objects  
     25       for use in the BwGrid --> 
     26  <xsl:template match="attendees" mode="loadBwGrid"> 
     27    <xsl:for-each select="attendee"> 
     28      {name:"<xsl:value-of select="cn"/>",uid:"<xsl:value-of select="attendeeUri"/>",role:"<xsl:value-of select="role"/>",status:"<xsl:value-of select="partstat"/>",type:"person"}<xsl:if test="position()!=last()">,</xsl:if> 
     29    </xsl:for-each> 
     30  </xsl:template> 
     31   
     32   
     33  <!-- THE FOLLOWING TEMPLATE IS DEPRECATED, BUT MUST REMAIN FOR NOW  --> 
     34  <xsl:template name="attendees"> 
    2535    <h2> 
    2636      <span class="formButtons"><input type="button" value="{$bwStr-Atnd-Continue}" onclick="window.location='{$gotoEditEvent}'"/></span> 
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/head.xsl

    r2913 r2942  
    183183         
    184184        var bwGridSDate = new Date("<xsl:value-of select="/bedework/formElements/form/start/yearText/input/@value"/>/<xsl:value-of select="/bedework/formElements/form/start/month/select/option[@selected = 'selected']/@value"/>/<xsl:value-of select="/bedework/formElements/form/start/day/select/option[@selected = 'selected']/@value"/>"); 
    185         var bwGridAttees = new Array({name:"Arlen Johnson",uid:"johnsa@mysite.edu",role:"CHAIR",status:"ACCEPTED",type:"person"},{name:"",uid:"douglm@mysite.edu",role:"REQ-PARTICIPANT",status:"NEEDS-ACTION",type:"person"}); 
    186         var bwGridOrganizer = "<xsl:value-of select="substring-after(/bedework/formElements/form/organizer/organizerUri,'mailto:')"/>"; 
     185        var bwGridAttees = new Array(<xsl:apply-templates select="/bedework/formElements/form/attendees" mode="loadBwGrid"/>); 
     186        var bwGridOrganizer = "<xsl:value-of select="/bedework/formElements/form/organizer/organizerUri"/>"; 
    187187        var bwGrid = new bwSchedulingGrid("bwFreeBusyDisplay",bwGridSDate,8,17,bwGridAttees,true,100,"<xsl:value-of select="$resourcesRoot"/>","<xsl:value-of select="$requestFreeBusy"/>",bwGridOrganizer); 
    188188         
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkScheduling.js

    r2937 r2942  
    1717 under the License. 
    1818 */ 
    19 // THE CONTENTS OF THIS FILE WILL MOVE INTO bedeworkAttendees.js 
    2019 
    2120 
     
    267266   
    268267  this.removeAttendee = function(index) { 
     268    var uid = bwGrid.attendees[index].uid; 
     269     
     270    // try to remove the attendee from the back end 
     271    $.ajax({ 
     272      type: "POST", 
     273      url: "http://localhost:8080/ucal/event/attendeesForEvent.do", 
     274      data: "uri=" + uid + "&attendee=true&delete=true", 
     275      success: function(){ 
     276      }, 
     277      error: function(msg) { 
     278        // there was a problem 
     279        alert(msg.statusText); 
     280      } 
     281    }); 
     282     
     283    /* remove the attendee from the local array. */ 
    269284    this.attendees.splice(index, 1); 
    270     this.requestFreeBusy();  
     285    if (this.attendees.length) { 
     286      bwGrid.requestFreeBusy(); 
     287    } else { 
     288      bwGrid.display(); 
     289    } 
    271290  }; 
    272291   
     
    632651          attendeeNameHtml += curAttendee.name; 
    633652        } else { 
    634           attendeeNameHtml += attendeeAddress; 
     653          if (attendeeAddress.indexOf("mailto:") != -1) { 
     654            attendeeNameHtml += attendeeAddress.substring(7); 
     655          } else { 
     656            attendeeNameHtml += attendeeAddress; 
     657          }  
    635658        } 
    636659        attendeeNameHtml += '</span>';