Changeset 2171

Show
Ignore:
Timestamp:
05/13/09 17:09:53
Author:
johnsa
Message:

set and remove xprops for aliases explicitly

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/resources/javascript/bedework/bedeworkXProperties.js

    r2170 r2171  
    3131// ======================================================================== 
    3232 
     33var bwXPropertyAlias = "X-BEDEWORK-ALIAS"; 
    3334var bwXPropertyImage = "X-BEDEWORK-IMAGE"; 
    3435var bwXPropertySubmittedBy = "X-BEDEWORK-SUBMITTEDBY"; 
     
    133134  } 
    134135 
     136  this.removeByValue = function(name, value) { 
     137    index = this.getIndexByValue(name, value); 
     138    if (index > -1) { 
     139      xproperties.splice(index,1); 
     140    } 
     141  } 
     142 
    135143  this.getIndex = function(name) { 
    136144    for (var i = 0; i < xproperties.length; i++) { 
     
    138146      if (curXprop.name == name) { 
    139147        return i; 
     148      } 
     149    } 
     150    return -1; 
     151  } 
     152 
     153  this.getIndexByValue = function(name,value) { 
     154    for (var i = 0; i < xproperties.length; i++) { 
     155      var curXprop = xproperties[i]; 
     156      if (curXprop.name == name) { 
     157        if (curXprop.value == value) { 
     158          return i; 
     159        } 
    140160      } 
    141161    } 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r2170 r2171  
    25952595          </xsl:when> 
    25962596          <xsl:otherwise> 
    2597             <input type="checkbox" name="alias"> 
    2598               <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute> 
     2597            <xsl:variable name="virtualPath">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:variable> 
     2598            <input type="checkbox" name="alias" onclick="toggleBedeworkXProperty('X-BEDEWORK-ALIAS','{$virtualPath}',this.checked)"> 
     2599              <xsl:attribute name="value"><xsl:value-of select="$virtualPath"/></xsl:attribute> 
    25992600              <xsl:if test="path = /bedework/formElements/form/xproperties//X-BEDEWORK-ALIAS/values/text"><xsl:attribute name="checked"><xsl:value-of select="checked"/></xsl:attribute></xsl:if> 
    26002601            </input> 
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js

    r2170 r2171  
    376376  // commit all xproperties back to the form 
    377377  bwXProps.generate(formObj); 
     378} 
     379function toggleBedeworkXProperty(xprop,value,checked) { 
     380  if (!checked) { 
     381    bwXProps.removeByValue(xprop, value); 
     382  } else { 
     383    bwXProps.update(bwXPropertyAlias,[],value,false); 
     384  } 
    378385} 
    379386function claimPendingEvent(group,user) { 
     
    725732  sntext.value = "Your event has been approved and is now published.\n\nEVENT DETAILS\n-------------\n\nTitle: " + eventTitle + "\nURL: " + eventUrlPrefix + "&" + publishingCal; 
    726733} 
     734 
    727735function doRejectEvent(reason,eventTitle) { 
    728736 
  • trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

    r2147 r2171  
    838838            <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
    839839              <xsl:variable name="calUrl" select="values/text"/> 
    840               <a href="{$setSelection}&amp;calUrl={$calUrl}&amp;setappvar=curCollection({$calUrl})"> 
     840              <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$calUrl})"> 
    841841                <xsl:call-template name="substring-afterLastInstanceOf"> 
    842842                  <xsl:with-param name="string" select="values/text"/> 
     
    14511451      </xsl:choose> 
    14521452    </xsl:variable> 
    1453     <xsl:variable name="url" select="encodedPath"/> 
    14541453    <xsl:variable name="virtualPath"><xsl:call-template name="url-encode"><xsl:with-param name="str">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:with-param></xsl:call-template></xsl:variable> 
    14551454    <li class="{$itemClass}"> 
    14561455      <xsl:variable name="calPath" select="path"/> 
    1457       <a href="{$setSelection}&amp;calUrl={$url}&amp;virtualPath={$virtualPath}&amp;setappvar=curCollection({$calPath})" title="view calendar"><xsl:value-of select="name"/></a> 
     1456      <a href="{$setSelection}&amp;virtualPath={$virtualPath}&amp;setappvar=curCollection({$calPath})" title="view calendar"><xsl:value-of select="name"/></a> 
    14581457      <xsl:variable name="calPath" select="path"/> 
    14591458      <span class="exportCalLink"> 
  • trunk/deployment/webpublic/webapp/resources/demoskins/SoEDepartmental/default/default/default.xsl

    r2147 r2171  
    837837            <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
    838838              <xsl:variable name="calUrl" select="values/text"/> 
    839               <a href="{$setSelection}&amp;calUrl={$calUrl}&amp;setappvar=curCollection({$calUrl})"> 
     839              <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$calUrl})"> 
    840840                <xsl:call-template name="substring-afterLastInstanceOf"> 
    841841                  <xsl:with-param name="string" select="values/text"/> 
     
    14501450      </xsl:choose> 
    14511451    </xsl:variable> 
    1452     <xsl:variable name="url" select="encodedPath"/> 
    14531452    <xsl:variable name="virtualPath"><xsl:call-template name="url-encode"><xsl:with-param name="str">/user<xsl:for-each select="ancestor-or-self::calendar/name">/<xsl:value-of select="."/></xsl:for-each></xsl:with-param></xsl:call-template></xsl:variable> 
    14541453    <li class="{$itemClass}"> 
    14551454      <xsl:variable name="calPath" select="path"/> 
    1456       <a href="{$setSelection}&amp;calUrl={$url}&amp;virtualPath={$virtualPath}&amp;setappvar=curCollection({$calPath})" title="view calendar"><xsl:value-of select="name"/></a> 
     1455      <a href="{$setSelection}&amp;virtualPath={$virtualPath}&amp;setappvar=curCollection({$calPath})" title="view calendar"><xsl:value-of select="name"/></a> 
    14571456      <xsl:variable name="calPath" select="path"/> 
    14581457      <span class="exportCalLink"> 
    1459         <a href="{$calendar-fetchForExport}&amp;calPath={$calPath}&amp;virtualPath={$virtualPath}" title="export calendar as iCal"> 
     1458        <a href="{$calendar-fetchForExport}&amp;virtualPath={$virtualPath}" title="export calendar as iCal"> 
    14601459          <img src="{$resourcesRoot}/images/calIconExport-sm.gif" width="13" height="13" alt="export calendar" border="0"/> 
    14611460        </a>