Changeset 1244

Show
Ignore:
Timestamp:
01/21/07 01:48:30
Author:
johnsa
Message:

user client:

- set the calendar when adding an event if

there is only one writable calendar available
to the user

Files:

Legend:

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

    r1241 r1244  
    18661866    <!-- this tab is visible by default --> 
    18671867    <div id="bwEventTab-Basic"> 
    1868     <!--<h3>Basic Event Recurrence:</h3>--> 
    18691868      <table cellspacing="0" class="common dottedBorder"> 
    18701869        <!--  Calendar in which to place event  --> 
     
    18741873          </td> 
    18751874          <td class="fieldval"> 
    1876             <xsl:variable name="newCalPath" select="form/calendar/path"/> 
    1877             <input type="hidden" name="newCalPath" value="{$newCalPath}"/> 
    1878             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable> 
    1879  
    1880             <span id="bwEventCalDisplay"> 
    1881               <xsl:choose> 
    1882                 <xsl:when test="contains(form/calendar/path,$userPath)"> 
    1883                   <xsl:value-of select="substring-after(form/calendar/path,$userPath)"/> 
    1884                 </xsl:when> 
    1885                 <xsl:otherwise> 
    1886                   <xsl:value-of select="form/calendar/path"/> 
    1887                 </xsl:otherwise> 
    1888               </xsl:choose> 
    1889             </span> 
    1890             <input type="button" onclick="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" value="select calendar" class="small"/> 
    1891  
     1875            <!-- the string "user/" should not be hard coded; fix in 3.3.1 --> 
     1876            <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> 
     1877            <xsl:variable name="writableCalendars"> 
     1878              <xsl:value-of select=" 
     1879                count(/bedework/myCalendars//calendar[calType = '1' and 
     1880                       currentAccess/current-user-privilege-set/privilege/write-content]) + 
     1881                count(/bedework/mySubscriptions//calendar[calType = '1' and 
     1882                       currentAccess/current-user-privilege-set/privilege/write-content and 
     1883                       (not(contains(path,$userPath)))])"/> 
     1884            </xsl:variable> 
     1885            <xsl:choose> 
     1886              <xsl:when test="/bedework/creating = 'true' and $writableCalendars = 1"> 
     1887                <!-- there is only 1 writable calendar, so find it by looking down both trees at once --> 
     1888                <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[calType = '1' and 
     1889                         currentAccess/current-user-privilege-set/privilege/write-content]/path"/><xsl:value-of select="/bedework/mySubscriptions//calendar[calType = '1' and 
     1890                       currentAccess/current-user-privilege-set/privilege/write-content and 
     1891                       (not(contains(path,$userPath)))]/path"/></xsl:variable> 
     1892 
     1893                <input type="hidden" name="newCalPath" value="{$newCalPath}"/> 
     1894 
     1895                <xsl:variable name="userFullPath"><xsl:value-of select="$userPath"/>/</xsl:variable> 
     1896                <span id="bwEventCalDisplay"> 
     1897                  <xsl:choose> 
     1898                    <xsl:when test="contains($newCalPath,$userFullPath)"> 
     1899                      <xsl:value-of select="substring-after($newCalPath,$userFullPath)"/> 
     1900                    </xsl:when> 
     1901                    <xsl:otherwise> 
     1902                      <xsl:value-of select="$newCalPath"/> 
     1903                    </xsl:otherwise> 
     1904                  </xsl:choose> 
     1905                </span> 
     1906              </xsl:when> 
     1907              <xsl:otherwise> 
     1908                <input type="hidden" name="newCalPath"> 
     1909                  <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
     1910                </input> 
     1911 
     1912                <xsl:variable name="userFullPath"><xsl:value-of select="$userPath"/>/</xsl:variable> 
     1913                <span id="bwEventCalDisplay"> 
     1914                  <xsl:choose> 
     1915                    <xsl:when test="contains(form/calendar/path,$userFullPath)"> 
     1916                      <xsl:value-of select="substring-after(form/calendar/path,$userFullPath)"/> 
     1917                    </xsl:when> 
     1918                    <xsl:otherwise> 
     1919                      <xsl:value-of select="form/calendar/path"/> 
     1920                    </xsl:otherwise> 
     1921                  </xsl:choose> 
     1922                </span> 
     1923 
     1924                <input type="button" onclick="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" value="select calendar" class="small"/> 
     1925              </xsl:otherwise> 
     1926            </xsl:choose> 
    18921927          </td> 
    18931928        </tr>