Changeset 1727

Show
Ignore:
Timestamp:
01/30/08 17:40:22
Author:
johnsa
Message:

web clients: clean up setting of all day event
web submit: better support for multiple submission calendars

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/deployment/websubmit/webapp/resources/demoskins/default/default/default.xsl

    r1684 r1727  
    468468          <!-- ======== --> 
    469469          <!--  the string "user/" should not be hard coded; fix this --> 
    470           <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> 
    471           <xsl:variable name="writableCalendars"> 
    472             <xsl:value-of select=" 
    473               count(/bedework/myCalendars//calendar[calType = '1' and 
    474                      currentAccess/current-user-privilege-set/privilege/write-content]) + 
    475               count(/bedework/mySubscriptions//calendar[calType = '1' and 
    476                      currentAccess/current-user-privilege-set/privilege/write-content and 
    477                      (not(contains(path,$userPath)))])"/> 
     470          <xsl:variable name="submissionCalendars"> 
     471            <xsl:value-of select="count(/bedework/myCalendars//calendar[starts-with(path,/bedework/submissionsRoot/unencoded) and calType='1']) = '1'"/> 
    478472          </xsl:variable> 
    479473          <tr> 
    480             <xsl:if test="$writableCalendars = 1"> 
     474            <xsl:if test="$submissionCalendars = 1"> 
    481475              <xsl:attribute name="class">invisible</xsl:attribute> 
    482476              <!-- hide this row altogether if there is only one calendar; if you want the calendar 
     
    488482            <td class="fieldval"> 
    489483              <xsl:choose> 
    490                 <xsl:when test="$writableCalendars = 1"> 
     484                <xsl:when test="$submissionCalendars = 1"> 
    491485                  <!-- there is only 1 writable calendar, so find it by looking down both trees at once --> 
    492                   <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[calType = '1' and 
    493                            currentAccess/current-user-privilege-set/privilege/write-content]/path"/><xsl:value-of select="/bedework/mySubscriptions//calendar[calType = '1' and 
    494                          currentAccess/current-user-privilege-set/privilege/write-content and 
    495                          (not(contains(path,$userPath)))]/path"/></xsl:variable> 
    496  
     486                  <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[starts-with(path,/bedework/submissionsRoot/unencoded) and calType='1']/path"/></xsl:variable> 
    497487                  <input type="hidden" name="newCalPath" value="{$newCalPath}"/> 
    498488 
    499                   <xsl:variable name="userFullPath"><xsl:value-of select="$userPath"/>/</xsl:variable> 
    500489                  <span id="bwEventCalDisplay"> 
    501                     <xsl:choose> 
    502                       <xsl:when test="contains($newCalPath,$userFullPath)"> 
    503                         <xsl:value-of select="substring-after($newCalPath,$userFullPath)"/> 
    504                       </xsl:when> 
    505                       <xsl:otherwise> 
    506                         <xsl:value-of select="$newCalPath"/> 
    507                       </xsl:otherwise> 
    508                     </xsl:choose> 
     490                    <xsl:value-of select="$newCalPath"/> 
    509491                  </span> 
    510492                </xsl:when> 
    511493                <xsl:otherwise> 
    512                   <input type="hidden" name="newCalPath" id="bwNewCalPathField"> 
    513                     <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
    514                   </input> 
    515  
    516                   <xsl:variable name="userFullPath"><xsl:value-of select="$userPath"/>/</xsl:variable> 
    517                   <span id="bwEventCalDisplay"> 
    518                     <xsl:choose> 
    519                       <xsl:when test="contains(form/calendar/path,$userFullPath)"> 
    520                         <xsl:value-of select="substring-after(form/calendar/path,$userFullPath)"/> 
    521                       </xsl:when> 
    522                       <xsl:otherwise> 
    523                         <xsl:value-of select="form/calendar/path"/> 
    524                       </xsl:otherwise> 
    525                     </xsl:choose> 
    526                     <xsl:text> </xsl:text> 
    527                     <!-- this final text element is required to avoid an empty 
    528                          span element which is improperly rendered in the browser --> 
    529                   </span> 
    530  
     494                  <select name="newCalPath" id="bwNewCalPathField"> 
     495                    <xsl:for-each select="/bedework/myCalendars//calendar[starts-with(path,/bedework/submissionsRoot/unencoded) and calType='1']"> 
     496                      <option> 
     497                        <xsl:attribute name="value"><xsl:value-of select="/bedework/submissionsRoot/unencoded"/></xsl:attribute> 
     498                        <xsl:value-of select="substring-after(substring-after(path,/bedework/submissionsRoot/unencoded),'/')"/> 
     499                      </option> 
     500                    </xsl:for-each> 
     501                  </select> 
    531502                </xsl:otherwise> 
    532503              </xsl:choose>