Changeset 1669

Show
Ignore:
Timestamp:
12/12/07 17:47:26
Author:
johnsa
Message:

web submit and admin client:
display submission comments in the admin client when working with a submitted event.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/webadmin/webapp/resources/default/default/default.css

    r1663 r1669  
    309309  background-color: #ff3; 
    310310} 
     311#bwSubmittedEventCommentBlock { 
     312  font-size: 0.9em; 
     313  padding: 1em; 
     314  border: 1px solid #ccc; 
     315  background-color: #ffe; 
     316  color: black; 
     317} 
     318#bwSubmittedEventCommentBlock h4 { 
     319  display: inline; 
     320  font-size: 1.1em; 
     321} 
     322#bwSubmittedEventCommentBlock table { 
     323  margin: 1em 0 0 0; 
     324} 
     325#bwSubmittedEventCommentBlock td { 
     326  padding-left: 2em; 
     327} 
     328#bwSubmittedEventCommentBlock a.toggle { 
     329  padding-left: 1em; 
     330  font-size: 0.9em; 
     331} 
    311332#commonListTable { 
    312333  margin-bottom: 2em; 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r1665 r1669  
    940940 
    941941    <h2>Event Information</h2> 
     942 
     943    <!-- if a submitted event has comments, display them --> 
     944    <xsl:if test="normalize-space(form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value) != ''"> 
     945      <script type="text/javascript"> 
     946        bwSubmitComment = new bwSubmitComment('<xsl:value-of select="form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value"/>','bwSubmittedEventComment'); 
     947      </script> 
     948 
     949      <div id="bwSubmittedEventCommentBlock"> 
     950        <h4>Comments from Submitter</h4> 
     951        <a href="javascript:toggleVisibility('bwSubmittedEventComment');" class="toggle">show/hide</a> 
     952        <a href="javascript:bwSubmitComment.launch();" class="toggle">pop-up</a> 
     953        <div id="bwSubmittedEventComment"> 
     954        </div> 
     955      </div> 
     956      <script type="text/javascript"> 
     957        bwSubmitComment.display(); 
     958      </script> 
     959    </xsl:if> 
    942960 
    943961    <xsl:variable name="modEventAction" select="form/@action"/> 
  • trunk/deployment/webadmin/webapp/resources/resources/bedework.js

    r1548 r1669  
    66  identity = document.getElementById(id); 
    77  identity.className=newClass; 
     8} 
     9function toggleVisibility(id) { 
     10  if (document.getElementById(id).className == 'invisible') { 
     11    changeClass(id,'visible'); 
     12  } else { 
     13    changeClass(id,'invisible'); 
     14  } 
    815} 
    916// show hide items using a checkbox 
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js

    r1560 r1669  
    7272  } 
    7373 
    74   this.format= function() { 
     74  this.format = function() { 
    7575    var res = this.date + "\t" + this.time + "\t"; 
    7676 
     
    233233 
    234234    return res; 
     235  } 
     236} 
     237// ======================================================================== 
     238// Submitted event comments 
     239// ======================================================================== 
     240 
     241/* An comment accompanying a submitted event 
     242/* comment: the x-property string X-BEDEWORK-SUBMIT-COMMENT, tab delimited 
     243 * id: id of the div to be written to for display 
     244 */ 
     245function bwSubmitComment(comment,displayId) { 
     246  var commentVals = comment.split('\t'); 
     247  this.locationAddress = commentVals[0]; 
     248  this.locationSubaddress = commentVals[1]; 
     249  this.locationUrl = commentVals[2]; 
     250  this.contactName = commentVals[3]; 
     251  this.contactPhone = commentVals[4]; 
     252  this.contactUrl = commentVals[5]; 
     253  this.contactEmail = commentVals[6]; 
     254  this.category = commentVals[7]; 
     255  this.notes = commentVals[8]; 
     256 
     257  this.render = function() { 
     258    var output = ""; 
     259    output += '<table>'; 
     260    output += '<tr><th colspan="2">Suggested Location:</th><th colspan="2">Suggested Contact:</th></tr>'; 
     261    output += '<tr><td>Address:</td><td>' + this.locationAddress + '</td><td>Name:</td><td>' + this.contactName + '</td></tr>'; 
     262    output += '<tr><td>Subaddress:</td><td>' + this.locationSubddress + '</td><td>Phone:</td><td>' + this.contactPhone + '</td></tr>'; 
     263    output += '<tr><td>URL:</td><td>' + this.locationUrl + '</td><td>URL:</td><td>' + this.contactUrl + '</td></tr>'; 
     264    output += '<tr><td colspan="2"></td><td>Email:</td><td>' + this.contactEmail + '</td></tr>'; 
     265    output += '<tr><th colspan="4">Notes:</th></tr>'; 
     266    output += '<tr><td colspan="4">' + this.notes + '</td></tr>'; 
     267    output += '</table>'; 
     268 
     269    return output; 
     270  } 
     271 
     272  this.display = function() { 
     273    var showComment = document.getElementById(displayId); 
     274    showComment.innerHTML = this.render(); 
     275  } 
     276 
     277  // launch comment in a pop-up window 
     278  this.launch = function() { 
     279    var commentWindow = window.open("", "commentWindow", "width=800,height=400,scrollbars=yes,resizable=yes,alwaysRaised=yes,menubar=no,toolbar=no"); 
     280    commentWindow.document.open(); 
     281    commentWindow.document.writeln("<html><head><title>Submitted Event Comments</title>"); 
     282    commentWindow.document.writeln('<style type="text/css">body{background-color: #ffe; color: black; padding: 1em; font-size: 0.9em; font-family: Arial,sans-serif;}th{text-align: left;}td{padding-left: 2em;}</style></head>'); 
     283    commentWindow.document.writeln("<body><h2>Comments from Submitter</h2>"); 
     284    commentWindow.document.writeln(this.render()); 
     285    commentWindow.document.writeln("</body></html>"); 
     286    commentWindow.document.close(); 
    235287  } 
    236288} 
  • trunk/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js

    r1667 r1669  
    262262function setComment(formObj) { 
    263263  // set the submission comments (location, contact, and category suggestions) 
    264   // in xml format for easier post processing. 
    265   // add and remove values as the application grows. 
    266  
    267   var comment = "<location>"; 
    268   if (formObj["commentLocationAddress"].value != "") { 
    269     comment += "<address>" + formObj["commentLocationAddress"].value + "</address>"; 
    270   } 
    271   if (formObj["commentLocationSubaddress"].value != "") { 
    272     comment += "<subaddress>" + formObj["commentLocationSubaddress"].value + "</subaddress>"; 
    273   } 
    274   if (formObj["commentLocationURL"].value != "") { 
    275     comment += "<url>" + formObj["commentLocationURL"].value + "</url>"; 
    276   } 
    277   comment += "</location>"; 
    278   comment += "<contact>"; 
    279   if (formObj["commentContactName"].value != "") { 
    280     comment += "<name>" + formObj["commentContactName"].value + "</name>"; 
    281   } 
    282   if (formObj["commentContactPhone"].value != "") { 
    283     comment += "<phone>" + formObj["commentContactPhone"].value + "</phone>"; 
    284   } 
    285   if (formObj["commentContactURL"].value != "") { 
    286     comment += "<url>" + formObj["commentContactURL"].value + "</url>"; 
    287   } 
    288   if (formObj["commentContactEmail"].value != "") { 
    289     comment += "<email>" + formObj["commentContactEmail"].value + "</email>"; 
    290   } 
    291   comment += "</contact>"; 
    292   if (formObj["commentCategories"].value != "") { 
    293     comment += "<category>" + formObj["commentCategories"].value + "</category>"; 
    294   } 
     264  // in a parsable format that can be filtered on output. 
     265 
     266  var comment = ""; 
     267  comment += formObj["commentLocationAddress"].value + "\t"; 
     268  comment += formObj["commentLocationSubaddress"].value + "\t"; 
     269  comment += formObj["commentLocationURL"].value + "\t"; 
     270  comment += formObj["commentContactName"].value + "\t"; 
     271  comment += formObj["commentContactPhone"].value + "\t"; 
     272  comment += formObj["commentContactURL"].value + "\t"; 
     273  comment += formObj["commentContactEmail"].value + "\t"; 
     274  comment += formObj["commentCategories"].value; 
    295275 
    296276  formObj["xbwsubmitcomment"].value = comment;