Changeset 3283

Show
Ignore:
Timestamp:
06/21/11 13:53:53
Author:
johnsa
Message:

user web client: continued bug fix for handling only one writable calendar in event form

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • releases/bedework-3.7/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/eventForm.xsl

    r3282 r3283  
    208208       
    209209        <!--  Calendar  --> 
    210          
    211             <!-- the string "user/" should not be hard coded; fix this --> 
    212             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> 
    213             <xsl:variable name="writableCalendars"> 
    214               <xsl:value-of select=" 
    215                 count(/bedework/myCalendars//calendar[calType = '1' and 
    216                        currentAccess/current-user-privilege-set/privilege/write-content]) + 
    217                 count(/bedework/mySubscriptions//calendar[calType = '1' and 
    218                        currentAccess/current-user-privilege-set/privilege/write-content and 
    219                        (not(contains(path,$userPath)))])"/> 
    220             </xsl:variable> 
    221             <xsl:choose> 
    222               <xsl:when test="$writableCalendars = 1"> 
    223                 <!-- there is only 1 writable calendar, so find it by looking down both trees at once --> 
    224                 <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[calType = '1' and 
    225                          currentAccess/current-user-privilege-set/privilege/write-content]/path"/><xsl:value-of select="/bedework/mySubscriptions//calendar[calType = '1' and 
    226                        currentAccess/current-user-privilege-set/privilege/write-content and 
    227                        (not(contains(path,$userPath)))]/path"/></xsl:variable> 
    228                 <tr class="hidden"><td><input type="hidden" name="newCalPath" value="{$newCalPath}"/></td></tr> 
    229               </xsl:when> 
    230               <xsl:otherwise> 
    231                 <tr> 
    232                                           <td class="fieldname"> 
    233                                             <xsl:copy-of select="$bwStr-AEEF-Calendar"/><xsl:text> </xsl:text> 
    234                                           </td> 
    235                                           <td class="fieldval"> 
    236                                 <input type="hidden" name="newCalPath" id="bwNewCalPathField"> 
    237                                   <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
    238                                 </input> 
    239                                 <span id="bwEventCalDisplay"> 
    240                                   <xsl:value-of select="form/calendar/summary"/> 
    241                                   <xsl:text> </xsl:text> 
    242                                 </span> 
    243                                 <xsl:call-template name="selectCalForEvent"/> 
    244                               </td> 
    245                             </tr> 
    246               </xsl:otherwise> 
    247             </xsl:choose> 
     210        <xsl:choose> 
     211          <xsl:when test="count(form/calendars/select/option) = 1"> 
     212            <!-- there is only 1 writable calendar --> 
     213            <xsl:variable name="newCalPath"><xsl:value-of select="form/calendars/select/option/@value"/></xsl:variable> 
     214            <tr class="hidden"><td><input type="hidden" name="newCalPath" value="{$newCalPath}"/></td></tr> 
     215          </xsl:when> 
     216          <xsl:otherwise> 
     217            <tr> 
     218          <td class="fieldname"> 
     219            <xsl:copy-of select="$bwStr-AEEF-Calendar"/><xsl:text> </xsl:text> 
     220          </td> 
     221          <td class="fieldval"> 
     222              <input type="hidden" name="newCalPath" id="bwNewCalPathField"> 
     223                <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
     224              </input> 
     225              <span id="bwEventCalDisplay"> 
     226                <xsl:value-of select="form/calendar/summary"/> 
     227                <xsl:text> </xsl:text> 
     228              </span> 
     229              <xsl:call-template name="selectCalForEvent"/> 
     230            </td> 
     231          </tr> 
     232          </xsl:otherwise> 
     233        </xsl:choose> 
    248234         
    249235        <!--  Summary (title) of event  --> 
  • trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/eventForm.xsl

    r3282 r3283  
    208208       
    209209        <!--  Calendar  --> 
    210          
    211             <!-- the string "user/" should not be hard coded; fix this --> 
    212             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/></xsl:variable> 
    213             <xsl:variable name="writableCalendars"> 
    214               <xsl:value-of select=" 
    215                 count(/bedework/myCalendars//calendar[calType = '1' and 
    216                        currentAccess/current-user-privilege-set/privilege/write-content]) + 
    217                 count(/bedework/mySubscriptions//calendar[calType = '1' and 
    218                        currentAccess/current-user-privilege-set/privilege/write-content and 
    219                        (not(contains(path,$userPath)))])"/> 
    220             </xsl:variable> 
    221             <xsl:choose> 
    222               <xsl:when test="$writableCalendars = 1"> 
    223                 <!-- there is only 1 writable calendar, so find it by looking down both trees at once --> 
    224                 <xsl:variable name="newCalPath"><xsl:value-of select="/bedework/myCalendars//calendar[calType = '1' and 
    225                          currentAccess/current-user-privilege-set/privilege/write-content]/path"/><xsl:value-of select="/bedework/mySubscriptions//calendar[calType = '1' and 
    226                        currentAccess/current-user-privilege-set/privilege/write-content and 
    227                        (not(contains(path,$userPath)))]/path"/></xsl:variable> 
    228                 <tr class="hidden"><td><input type="hidden" name="newCalPath" value="{$newCalPath}"/></td></tr> 
    229               </xsl:when> 
    230               <xsl:otherwise> 
    231                 <tr> 
    232                                           <td class="fieldname"> 
    233                                             <xsl:copy-of select="$bwStr-AEEF-Calendar"/><xsl:text> </xsl:text> 
    234                                           </td> 
    235                                           <td class="fieldval"> 
    236                                 <input type="hidden" name="newCalPath" id="bwNewCalPathField"> 
    237                                   <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
    238                                 </input> 
    239                                 <span id="bwEventCalDisplay"> 
    240                                   <xsl:value-of select="form/calendar/summary"/> 
    241                                   <xsl:text> </xsl:text> 
    242                                 </span> 
    243                                 <xsl:call-template name="selectCalForEvent"/> 
    244                               </td> 
    245                             </tr> 
    246               </xsl:otherwise> 
    247             </xsl:choose> 
     210        <xsl:choose> 
     211          <xsl:when test="count(form/calendars/select/option) = 1"> 
     212            <!-- there is only 1 writable calendar --> 
     213            <xsl:variable name="newCalPath"><xsl:value-of select="form/calendars/select/option/@value"/></xsl:variable> 
     214            <tr class="hidden"><td><input type="hidden" name="newCalPath" value="{$newCalPath}"/></td></tr> 
     215          </xsl:when> 
     216          <xsl:otherwise> 
     217            <tr> 
     218          <td class="fieldname"> 
     219            <xsl:copy-of select="$bwStr-AEEF-Calendar"/><xsl:text> </xsl:text> 
     220          </td> 
     221          <td class="fieldval"> 
     222              <input type="hidden" name="newCalPath" id="bwNewCalPathField"> 
     223                <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
     224              </input> 
     225              <span id="bwEventCalDisplay"> 
     226                <xsl:value-of select="form/calendar/summary"/> 
     227                <xsl:text> </xsl:text> 
     228              </span> 
     229              <xsl:call-template name="selectCalForEvent"/> 
     230            </td> 
     231          </tr> 
     232          </xsl:otherwise> 
     233        </xsl:choose> 
    248234         
    249235        <!--  Summary (title) of event  -->