Changeset 1845

Show
Ignore:
Timestamp:
04/20/08 02:51:18
Author:
johnsa
Message:

submission client: quote x-prop param values

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/bedework-3.4.1.1/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl

    r1842 r1845  
    107107        <xsl:if test="/bedework/page = 'editEvent' and 
    108108                      normalize-space(/bedework/formElements/form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value) != ''"> 
    109           <xsl:attribute name="onload">initRXDates();initXProperties();getComments('standardForm','<xsl:value-of select="/bedework/formElements/form/xproperties/xproperty[@name='X-BEDEWORK-SUBMIT-COMMENT']/value"/>');</xsl:attribute> 
     109          <xsl:attribute name="onload">initRXDates();initXProperties();</xsl:attribute> 
    110110        </xsl:if> 
    111111        <div id="bedework"><!-- main wrapper div --> 
     
    906906          <p> 
    907907            <label for="commentLocationAddress">Address: </label> 
    908             <input type="text" name="commentLocationAddress" id="bwCommentLocationAddress"/> 
     908            <input type="text" name="commentLocationAddress" id="bwCommentLocationAddress"> 
     909              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-LOCATION-ADDRESS']"/></xsl:attribute> 
     910            </input> 
    909911          </p> 
    910912          <p> 
    911             <label for="commentLocationSubaddress"><em>Sub-address:</em> </label><input type="text" name="commentLocationSubaddress"/> 
     913            <label for="commentLocationSubaddress"><em>Sub-address:</em> </label> 
     914            <input type="text" name="commentLocationSubaddress" id="commentLocationSubaddress"> 
     915              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-LOCATION-SUBADDRESS']"/></xsl:attribute> 
     916            </input> 
    912917            <span class="note"> optional</span> 
    913918          </p> 
    914919          <p> 
    915             <label for="commentLocationURL"><em>URL:</em> </label><input type="text" name="commentLocationURL"/> 
     920            <label for="commentLocationURL"><em>URL:</em> </label> 
     921            <input type="text" name="commentLocationURL" id="commentLocationURL"> 
     922              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-LOCATION-URL']"/></xsl:attribute> 
     923            </input> 
    916924            <span class="note"> optional</span> 
    917925          </p> 
     
    937945          <p> 
    938946            <label for="commentContactName">Organization Name: </label> 
    939             <input type="text" name="commentContactName" id="bwCommentContactName" size="40"/> 
     947            <input type="text" name="commentContactName" id="bwCommentContactName" size="40"> 
     948              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-NAME']"/></xsl:attribute> 
     949            </input> 
    940950            <span class="note"> Please limit contacts to organizations, not individuals.</span> 
    941951          </p> 
    942952          <p> 
    943             <label for="commentContactPhone"><em>Phone:</em> </label><input type="text" name="commentContactPhone"/> 
     953            <label for="commentContactPhone"><em>Phone:</em> </label> 
     954            <input type="text" name="commentContactPhone"> 
     955              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-PHONE']"/></xsl:attribute> 
     956            </input> 
    944957            <span class="note"> optional</span> 
    945958          </p> 
    946959          <p> 
    947             <label for="commentContactURL"><em>URL:</em> </label><input type="text" name="commentContactURL"/> 
     960            <label for="commentContactURL"><em>URL:</em> </label> 
     961            <input type="text" name="commentContactURL"> 
     962              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-URL']"/></xsl:attribute> 
     963            </input> 
    948964            <span class="note"> optional</span> 
    949965          </p> 
    950966          <p> 
    951             <label for="commentContactEmail"><em>Email:</em> </label><input type="text" name="commentContactEmail"/> 
     967            <label for="commentContactEmail"><em>Email:</em> </label> 
     968            <input type="text" name="commentContactEmail"> 
     969              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CONTACT-EMAIL']"/></xsl:attribute> 
     970            </input> 
    952971            <span class="note"> optional</span> 
    953972          </p> 
     
    9941013          <p> 
    9951014            <label for="commentCategories">Category suggestion: </label> 
    996             <input type="text" name="commentCategories" size="30"/> 
     1015            <input type="text" name="commentCategories" size="30"> 
     1016              <xsl:attribute name="value"><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/parameters/node()[name()='X-BEDEWORK-PARAM-CATEGORIES']"/></xsl:attribute> 
     1017            </input> 
    9971018          </p> 
    9981019        </div> 
     
    10101031        <div id="bwCommentNotes"> 
    10111032          Please supply any final notes or instructions regarding your event:<br/> 
    1012           <textarea name="commentNotes" cols="60" rows="4">&#160;</textarea> 
     1033          <!-- note: don't remove the #160 from the textarea or browsers will see it as a closed tag when empty --> 
     1034          <textarea name="commentNotes" cols="60" rows="4"><!-- 
     1035           --><xsl:value-of select="form/xproperties/node()[name()='X-BEDEWORK-SUBMIT-COMMENT']/values/text"/>&#160;<!-- 
     1036           --></textarea> 
    10131037        </div> 
    10141038        <div class="eventSubmitButtons"> 
  • releases/bedework-3.4.1.1/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkEventForm.js

    r1842 r1845  
    245245  } 
    246246  setComments(formObj); 
    247   setRecurrence(formObj); 
     247  //setRecurrence(formObj); 
    248248  setBedeworkXProperties(formObj,submitter); 
    249   setAccessHow(formObj,1); 
     249  //setAccessHow(formObj,1); 
    250250  //setAccessAcl(formObj); 
    251251} 
     
    265265function setComments(formObj) { 
    266266  // set the submission comments (location, contact, and category suggestions) 
    267   // in a parsable format that can be filtered on output. 
    268  
    269   var comment = ""; 
    270   comment += formObj["commentLocationAddress"].value + "\t"; 
    271   comment += formObj["commentLocationSubaddress"].value + "\t"; 
    272   comment += formObj["commentLocationURL"].value + "\t"; 
    273   comment += formObj["commentContactName"].value + "\t"; 
    274   comment += formObj["commentContactPhone"].value + "\t"; 
    275   comment += formObj["commentContactURL"].value + "\t"; 
    276   comment += formObj["commentContactEmail"].value + "\t"; 
    277   comment += formObj["commentCategories"].value + "\t"; 
    278   comment += formObj["commentNotes"].value; 
    279  
    280   formObj["xbwsubmitcomment"].value = comment; 
     267  // as an xproperty.  Relies on bedeworkXProperties.js 
     268 
     269  bwXProps.update(bwXPropertySubmitComment, 
     270                  [[bwXParamLocationAddress,formObj["commentLocationAddress"].value], 
     271                   [bwXParamLocationSubAddress,formObj["commentLocationSubaddress"].value], 
     272                   [bwXParamLocationURL,formObj["commentLocationURL"].value], 
     273                   [bwXParamContactName,formObj["commentContactName"].value], 
     274                   [bwXParamContactPhone,formObj["commentContactPhone"].value], 
     275                   [bwXParamContactURL,formObj["commentContactURL"].value], 
     276                   [bwXParamContactEmail,formObj["commentContactEmail"].value], 
     277                   [bwXParamCategories,formObj["commentCategories"].value]], 
     278                  formObj["commentNotes"].value,true); 
    281279} 
    282280function getComments(formId,comment) { 
  • releases/bedework-3.4.1.1/deployment/websubmit/webapp/resources/demoskins/resources/bedeworkXProperties.js

    r1844 r1845  
    3838var bwXPropertySubmittedBy = "X-BEDEWORK-SUBMITTEDBY"; 
    3939var bwXPropertySubmitComment = "X-BEDEWORK-SUBMIT-COMMENT"; 
    40  
     40var bwXParamLocationAddress = "X-BEDEWORK-PARAM-LOCATION-ADDRESS"; 
     41var bwXParamLocationSubAddress = "X-BEDEWORK-PARAM-LOCATION-SUBADDRESS"; 
     42var bwXParamLocationURL = "X-BEDEWORK-PARAM-LOCATION-URL"; 
     43var bwXParamContactName = "X-BEDEWORK-PARAM-CONTACT-NAME"; 
     44var bwXParamContactPhone = "X-BEDEWORK-PARAM-CONTACT-PHONE"; 
     45var bwXParamContactURL = "X-BEDEWORK-PARAM-CONTACT-URL"; 
     46var bwXParamContactEmail = "X-BEDEWORK-PARAM-CONTACT-EMAIL"; 
     47var bwXParamCategories = "X-BEDEWORK-PARAM-CATEGORIES"; 
    4148 
    4249// ======================================================================== 
     
    6168    if (this.params.length) { 
    6269      for (var i = 0; i < this.params.length; i++) { 
    63         curXparams += ";" + this.params[i][0] + "=" + this.params[i][1]
     70        curXparams += ";" + this.params[i][0] + "=\"" + this.params[i][1] + "\""
    6471      } 
    6572    } 
     
    7784 
    7885  this.update = function(name, params, value, isUnique) { 
     86    // strip out any double quotes in the parameter values: 
     87    if (params.length) { 
     88      for (var i = 0; i < params.length; i++) { 
     89        var strippedParamValue = ""; 
     90        for (var j = 0; j < params[i][1].length; j++) { 
     91          var c = params[i][1][j]; 
     92          if (c != '"') { 
     93            strippedParamValue += c; 
     94          } 
     95        } 
     96        params[i][1] = strippedParamValue; 
     97      } 
     98    } 
     99    // add or update the xproperty: 
    79100    var xprop = new BwXProperty(name, params, value); 
    80101    if (isUnique && this.contains(name)) {