Changeset 2090

Show
Ignore:
Timestamp:
03/04/09 15:23:34
Author:
johnsa
Message:

admin client: updates to event form to account for multiple or single publishing calendars

Files:

Legend:

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

    r2087 r2090  
    4747 
    4848  <!-- DEFINE GLOBAL CONSTANTS --> 
     49 
    4950  <!-- URL of html resources (images, css, other html); by default this is 
    5051       set to the application root, but for the admin client 
     
    6465  <xsl:variable name="appRoot" select="/bedework/approot"/> 
    6566 
     67  <!-- Root folder of the submissions calendars used by the submissions client --> 
     68  <xsl:variable name="submissionsRootEncoded" select="/bedework/submissionsRoot/encoded"/> 
     69  <xsl:variable name="submissionsRootUnencoded" select="/bedework/submissionsRoot/unencoded"/> 
     70 
    6671  <!-- Properly encoded prefixes to the application actions; use these to build 
    6772       urls; allows the application to be used without cookies or within a portal. 
    6873       we will probably change the way we create these before long (e.g. build them 
    6974       dynamically in the xslt). --> 
    70  
    71   <xsl:variable name="submissionsRootEncoded" select="/bedework/submissionsRoot/encoded"/> 
    72   <xsl:variable name="submissionsRootUnencoded" select="/bedework/submissionsRoot/unencoded"/> 
    7375 
    7476  <!-- primary navigation, menu tabs --> 
     
    10271029      </xsl:choose> 
    10281030 
     1031      <!-- Set the underlying calendar; if there is more than one publishing calendar, the 
     1032           form below will test for that and allow this value to be changed.  --> 
     1033      <input type="hidden" name="newCalPath" id="newCalPath"> 
     1034        <xsl:choose> 
     1035          <xsl:when test="/bedework/creating='true'"> 
     1036            <xsl:attribute name="value"><xsl:value-of select="form/calendar/all/select/option/@value"/></xsl:attribute> 
     1037          </xsl:when> 
     1038          <xsl:otherwise> 
     1039            <xsl:attribute name="value"><xsl:value-of select="form/calendar/all/select/option[@selected]/@value"/></xsl:attribute> 
     1040          </xsl:otherwise> 
     1041        </xsl:choose> 
     1042      </input> 
     1043 
    10291044      <xsl:call-template name="submitEventButtons"/> 
    10301045 
     
    10381053          </td> 
    10391054        </tr> 
    1040         <!-- Disabling calendar selection is temporary - but we must determine if we're using 
    1041              a single calendar model (e.g. excluding submissions calendar, etc). The following value should *not* be 
    1042              hard coded, but we'll do this for the moment. --> 
    1043         <input type="hidden" name="newCalPath" value="/public/cals/MainCal"/> 
    1044         <!-- 
    1045         <xsl:if test="not(starts-with(form/calendar/path,$submissionsRootUnencoded))"> 
     1055 
     1056        <xsl:if test="count(form/calendar/all/select/option) &gt; 1 and 
     1057                      not(starts-with(form/calendar/path,$submissionsRootUnencoded))"> 
     1058        <!-- check to see if we have more than one publishing calendar 
     1059             but disallow directly setting for pending events --> 
    10461060          <tr> 
    10471061            <td class="fieldName"> 
    10481062              Calendar: 
    1049               <input type="hidden" name="newCalPath" value=""> 
    1050                 <xsl:attribute name="value"><xsl:value-of select="form/calendar/all/select/option[@selected]/@value"/></xsl:attribute> 
    1051               </input> 
    10521063            </td> 
    10531064            <td> 
    10541065              <xsl:if test="form/calendar/preferred/select/option"> 
    1055                 -  - Display the preferred calendars by default if they exist - - 
     1066                <!-- Display the preferred calendars by default if they exist --> 
    10561067                <select name="bwPreferredCalendars" id="bwPreferredCalendars" onchange="this.form.newCalPath.value = this.value"> 
    10571068                  <option value=""> 
     
    10751086                </select> 
    10761087              </xsl:if> 
    1077               - - hide the listing of all calendars if preferred calendars exist, otherwise show them - - 
     1088              <!-- hide the listing of all calendars if preferred calendars exist, otherwise show them --> 
    10781089              <select name="bwAllCalendars" id="bwAllCalendars" onchange="this.form.newCalPath.value = this.value;"> 
    10791090                <xsl:if test="form/calendar/preferred/select/option"> 
     
    11001111              </select> 
    11011112              <xsl:text> </xsl:text> 
    1102               - - allow for toggling between the preferred and all calendars listings if preferred 
    1103                    calendars exist - - 
     1113              <!-- allow for toggling between the preferred and all calendars listings if preferred 
     1114                   calendars exist --> 
    11041115              <xsl:if test="form/calendar/preferred/select/option"> 
    11051116                <input type="radio" name="toggleCalendarLists" value="preferred" checked="checked" onclick="changeClass('bwPreferredCalendars','shown');changeClass('bwAllCalendars','invisible');this.form.newCalPath.value = this.form.bwPreferredCalendars.value;"/> 
     
    11141125            </td> 
    11151126          </tr> 
    1116         </xsl:if> --> 
     1127        </xsl:if> 
    11171128 
    11181129        <tr> 
     
    24332444      <tr> 
    24342445        <xsl:choose> 
    2435           <xsl:when test="starts-with(form/calendar/path,$submissionsRootUnencoded)"> 
     2446          <xsl:when test="starts-with(form/calendar/event/path,$submissionsRootUnencoded)"> 
    24362447            <td> 
    2437               <div id="publishBox" class="invisible"> 
    2438                 <div id="publishBoxCloseButton"> 
    2439                   <a href="javascript:resetPublishBox('calendarId')"> 
    2440                     <img src="{$resourcesRoot}/resources/closeIcon.gif" width="20" height="20" alt="close" border="0"/> 
    2441                   </a> 
    2442                 </div> 
    2443                 <strong>Select a calendar in which to publish this event:</strong><br/> 
    2444                 <select name="calendarId" id="calendarId"> 
    2445                   <option> 
    2446                     <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
    2447                     Select: 
    2448                   </option> 
    2449                   <xsl:for-each select="form/calendar/all/select/option"> 
    2450                     <xsl:sort select="." order="ascending"/> 
    2451                     <option> 
    2452                       <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute> 
    2453                       <xsl:if test="@selected"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 
    2454                       <xsl:choose> 
    2455                         <xsl:when test="starts-with(node(),/bedework/submissionsRoot/unencoded)"> 
    2456                           submitted events 
    2457                         </xsl:when> 
    2458                         <xsl:otherwise> 
    2459                           <xsl:value-of select="substring-after(node(),'/public/')"/> 
    2460                         </xsl:otherwise> 
    2461                       </xsl:choose> 
    2462                     </option> 
    2463                   </xsl:for-each> 
    2464                 </select> 
    2465                 <input type="submit" name="publishEvent" value="Publish" onclick="changeClass('publishBox','invisible')"/> 
    2466                 <xsl:if test="$portalFriendly = 'false'"> 
    2467                   <br/> 
    2468                   <span id="calDescriptionsLink"> 
    2469                     <a href="javascript:launchSimpleWindow('{$calendar-fetchDescriptions}')">calendar descriptions</a> 
    2470                   </span> 
    2471                 </xsl:if> 
    2472               </div> 
    2473               <input type="submit" name="updateSubmitEvent" value="Update Event"/> 
    2474               <input type="button" name="publishEvent" value="Publish Event" onclick="changeClass('publishBox','visible')"/> 
    2475               <input type="submit" name="cancel" value="Cancel"/> 
     2448              <!-- no need for a publish box in the single calendar model unless we have more than one calendar; --> 
     2449              <xsl:choose> 
     2450                <xsl:when test="count(form/calendar/all/select/option) &gt; 1"><!-- test for the presence of more than one publishing calendar --> 
     2451                  <div id="publishBox" class="invisible"> 
     2452                    <div id="publishBoxCloseButton"> 
     2453                      <a href="javascript:resetPublishBox('calendarId')"> 
     2454                        <img src="{$resourcesRoot}/resources/closeIcon.gif" width="20" height="20" alt="close" border="0"/> 
     2455                      </a> 
     2456                    </div> 
     2457                    <strong>Select a calendar in which to publish this event:</strong><br/> 
     2458                    <select name="calendarId" id="calendarId"> 
     2459                      <option> 
     2460                        <xsl:attribute name="value"><xsl:value-of select="form/calendar/path"/></xsl:attribute> 
     2461                        Select: 
     2462                      </option> 
     2463                      <xsl:for-each select="form/calendar/all/select/option"> 
     2464                        <xsl:sort select="." order="ascending"/> 
     2465                        <option> 
     2466                          <xsl:attribute name="value"><xsl:value-of select="@value"/></xsl:attribute> 
     2467                          <xsl:if test="@selected"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if> 
     2468                          <xsl:choose> 
     2469                            <xsl:when test="starts-with(node(),/bedework/submissionsRoot/unencoded)"> 
     2470                              submitted events 
     2471                            </xsl:when> 
     2472                            <xsl:otherwise> 
     2473                              <xsl:value-of select="substring-after(node(),'/public/')"/> 
     2474                            </xsl:otherwise> 
     2475                          </xsl:choose> 
     2476                        </option> 
     2477                      </xsl:for-each> 
     2478                    </select> 
     2479                    <input type="submit" name="publishEvent" value="Publish" onclick="changeClass('publishBox','invisible')"/> 
     2480                    <xsl:if test="$portalFriendly = 'false'"> 
     2481                      <br/> 
     2482                      <span id="calDescriptionsLink"> 
     2483                        <a href="javascript:launchSimpleWindow('{$calendar-fetchDescriptions}')">calendar descriptions</a> 
     2484                      </span> 
     2485                    </xsl:if> 
     2486                  </div> 
     2487                  <input type="submit" name="updateSubmitEvent" value="Update Event"/> 
     2488                  <input type="button" name="publishEvent" value="Publish Event" onclick="changeClass('publishBox','visible')"/> 
     2489                  <input type="submit" name="cancel" value="Cancel"/> 
     2490                </xsl:when> 
     2491                <xsl:otherwise> 
     2492                  <!-- we are using the single calendar model for public events --> 
     2493                  <input type="submit" name="updateSubmitEvent" value="Update Event"/> 
     2494                  <input type="button" name="publishEvent" value="Publish Event"> 
     2495                    <xsl:attribute name="onclick">publishEvent('<xsl:value-of select="form/calendar/all/select/option/@value"/>');</xsl:attribute> 
     2496                  </input> 
     2497                  <input type="submit" name="cancel" value="Cancel"/> 
     2498                </xsl:otherwise> 
     2499              </xsl:choose> 
    24762500            </td> 
    24772501            <td align="right"> 
  • trunk/deployment/webadmin/webapp/resources/resources/bedeworkEventForm.js

    r2088 r2090  
    690690} 
    691691 
     692function publishEvent(publishingCal) { 
     693  // User has submitted the event when there is only a single publishing calendar. 
     694  // Update the newCalPath to reflect the publishing calendar: 
     695  var newCalPath = document.getElementById("newCalPath"); 
     696  newCalPath = publishingCal; 
     697} 
     698 
     699