Changeset 2131

Show
Ignore:
Timestamp:
04/13/09 20:26:12
Author:
johnsa
Message:

updates to category handling

Files:

Legend:

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

    r2125 r2131  
    10711071  padding: 0; 
    10721072} 
     1073.defaultCategory { 
     1074  color: #999; 
     1075  background-color: transparent; 
     1076} 
    10731077#bwGetCollectionForm { 
    10741078  margin-top: 1em; 
  • trunk/deployment/webadmin/webapp/resources/default/default/default.xsl

    r2130 r2131  
    919919        <th>Start</th> 
    920920        <th>End</th> 
     921        <th>Topical Areas</th> 
    921922        <th>Categories</th> 
    922         <th>Calendar</th
     923        <!-- <th>Calendar</th> --
    923924        <th>Description</th> 
    924925      </tr> 
     
    969970          </td> 
    970971          <td class="calcat"> 
     972            <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS"> 
     973              <xsl:call-template name="substring-afterLastInstanceOf"> 
     974                <xsl:with-param name="string" select="values/text"/> 
     975                <xsl:with-param name="char">/</xsl:with-param> 
     976              </xsl:call-template><br/> 
     977            </xsl:for-each> 
     978          </td> 
     979          <td class="calcat"> 
    971980            <xsl:for-each select="categories/category"> 
    972981              <xsl:value-of select="word"/><br/> 
    973982            </xsl:for-each> 
    974983          </td> 
    975           <td> 
     984          <!-- <td> 
    976985            <xsl:value-of select="calendar/name"/> 
    977           </td> 
     986          </td>--> 
    978987          <td> 
    979988            <xsl:value-of select="description"/> 
     
    22642273          categories can be set by the event administrator if the calendar suite preferences allow it 
    22652274          --> 
    2266  
    22672275        <tr> 
    22682276          <td class="fieldName"> 
     
    22882296                          <xsl:attribute name="onchange">setCatChBx('pref-<xsl:value-of select="uid"/>','all-<xsl:value-of select="uid"/>')</xsl:attribute> 
    22892297                          <xsl:if test="uid = ../../current//category/uid"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
     2298                          <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     2299                            <xsl:attribute name="disabled">disabled</xsl:attribute> 
     2300                          </xsl:if> 
    22902301                          <xsl:value-of select="keyword"/> 
    22912302                        </input><br/> 
     
    23002311                          <xsl:attribute name="onchange">setCatChBx('pref-<xsl:value-of select="uid"/>','all-<xsl:value-of select="uid"/>')</xsl:attribute> 
    23012312                          <xsl:if test="uid = ../../current//category/uid"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
     2313                          <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     2314                            <xsl:attribute name="disabled">disabled</xsl:attribute> 
     2315                          </xsl:if> 
    23022316                          <xsl:value-of select="keyword"/> 
    23032317                        </input><br/> 
     
    23232337                        <xsl:if test="uid = ../../current//category/uid"> 
    23242338                          <xsl:attribute name="checked">checked</xsl:attribute> 
     2339                          <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     2340                            <xsl:attribute name="disabled">disabled</xsl:attribute> 
     2341                          </xsl:if> 
    23252342                        </xsl:if> 
    23262343                        <xsl:value-of select="keyword"/> 
     
    23382355                        <xsl:if test="uid = ../../current//category/uid"> 
    23392356                          <xsl:attribute name="checked">checked</xsl:attribute> 
     2357                          <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     2358                            <xsl:attribute name="disabled">disabled</xsl:attribute> 
     2359                          </xsl:if> 
    23402360                        </xsl:if> 
    23412361                        <xsl:value-of select="keyword"/> 
     
    33383358  </xsl:template> 
    33393359 
     3360  <!-- form used for selecting categories in calendar and pref forms --> 
     3361  <xsl:template name="categorySelectionWidget"> 
     3362    <!-- show the selected categories --> 
     3363    <ul class="catlist"> 
     3364      <xsl:for-each select="/bedework/categories/current/category"> 
     3365        <xsl:sort select="keyword" order="ascending"/> 
     3366        <li> 
     3367          <input type="checkbox" name="catUid" checked="checked"> 
     3368            <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
     3369          </input> 
     3370          <xsl:value-of select="keyword"/> 
     3371        </li> 
     3372      </xsl:for-each> 
     3373    </ul> 
     3374    <a href="javascript:toggleVisibility('calCategories','visible')"> 
     3375      show/hide unused categories 
     3376    </a> 
     3377    <div id="calCategories" class="invisible"> 
     3378      <ul class="catlist"> 
     3379        <xsl:for-each select="/bedework/categories/all/category"> 
     3380          <xsl:sort select="keyword" order="ascending"/> 
     3381          <!-- don't duplicate the selected categories --> 
     3382          <xsl:if test="not(uid = ../../current//category/uid)"> 
     3383            <li> 
     3384              <input type="checkbox" name="catUid"> 
     3385                <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
     3386              </input> 
     3387              <xsl:value-of select="keyword"/> 
     3388            </li> 
     3389          </xsl:if> 
     3390        </xsl:for-each> 
     3391      </ul> 
     3392    </div> 
     3393  </xsl:template> 
     3394 
    33403395<!--+++++++++++++++ Calendars ++++++++++++++++++++--> 
    33413396  <xsl:template match="calendars" mode="calendarCommon"> 
     
    35723627                      <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
    35733628                      <xsl:if test="uid = ../../current//category/uid"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
     3629                      <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     3630                        <xsl:attribute name="disabled">disabled</xsl:attribute> 
     3631                      </xsl:if> 
     3632                      <xsl:value-of select="keyword"/> 
    35743633                    </input> 
    3575                     <xsl:value-of select="keyword"/> 
    35763634                  </li> 
    35773635                </xsl:for-each> 
     
    37733831                  <input type="checkbox" name="catUid" checked="checked"> 
    37743832                    <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
     3833                    <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     3834                      <xsl:attribute name="disabled">disabled</xsl:attribute> 
     3835                    </xsl:if> 
     3836                    <xsl:value-of select="keyword"/> 
    37753837                  </input> 
    3776                   <xsl:value-of select="keyword"/> 
    37773838                </li> 
    37783839              </xsl:for-each> 
     
    44814542                      <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
    44824543                      <xsl:if test="uid = ../../current//category/uid"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if> 
     4544                      <xsl:if test="uid = /bedework/currentCalSuite/defaultCategories//category/uid"> 
     4545                        <xsl:attribute name="disabled">disabled</xsl:attribute> 
     4546                      </xsl:if> 
     4547                      <xsl:value-of select="keyword"/> 
    44834548                    </input> 
    4484                     <xsl:value-of select="keyword"/> 
    44854549                  </li> 
    44864550                </xsl:for-each> 
     
    52835347  <xsl:template name="calSuitePrefs"> 
    52845348    <h2>Edit Calendar Suite Preferences</h2> 
    5285     <form name="userPrefsForm" method="post" action="{$calsuite-updatePrefs}"
     5349    <form name="userPrefsForm" method="post" action="{$calsuite-updatePrefs}" onsubmit="checkPrefCategories(this);"
    52865350      <table class="common2"> 
    52875351        <tr> 
     
    53575421          <th>Default Categories:</th> 
    53585422          <td> 
    5359             <!-- show the selected categories - in this case, iterate over 
    5360                  the "all" listing and reveal those that have been selected; 
    5361                  in this case, we have only the uids to go by, so we need to 
    5362                  match them up --> 
     5423            <!-- show the selected categories --> 
    53635424            <ul class="catlist"> 
    5364               <xsl:for-each select="/bedework/prefs/defaultCategories/category"> 
     5425              <xsl:for-each select="/bedework/categories/current/category"> 
    53655426                <xsl:sort select="keyword" order="ascending"/> 
    5366                 <xsl:if test="uid = /bedework/categories/current//category/uid"> 
    5367                   <li> 
    5368                     <input type="checkbox" name="defaultCategory" checked="checked"> 
    5369                       <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
    5370                     </input> 
     5427                <li> 
     5428                  <input type="checkbox" name="defaultCategory" checked="checked"> 
     5429                    <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
    53715430                    <xsl:value-of select="keyword"/> 
    5372                   </li
    5373                 </xsl:if
     5431                  </input
     5432                </li
    53745433              </xsl:for-each> 
    53755434            </ul> 
     
    53795438            <div id="calCategories" class="invisible"> 
    53805439              <ul class="catlist"> 
    5381                 <xsl:for-each select="/bedework/prefs/defaultCategories/category"> 
     5440                <xsl:for-each select="/bedework/categories/all/category"> 
    53825441                  <xsl:sort select="keyword" order="ascending"/> 
    53835442                  <!-- don't duplicate the selected categories --> 
     
    53865445                      <input type="checkbox" name="defaultCategory"> 
    53875446                        <xsl:attribute name="value"><xsl:value-of select="uid"/></xsl:attribute> 
     5447                        <xsl:value-of select="keyword"/> 
    53885448                      </input> 
    5389                       <xsl:value-of select="keyword"/> 
    53905449                    </li> 
    53915450                  </xsl:if> 
     
    53935452              </ul> 
    53945453            </div> 
     5454          </td> 
     5455        </tr> 
     5456        <tr> 
     5457          <th> 
     5458            Allow users to select categories in event form: 
     5459          </th> 
     5460          <td> 
     5461            <input type="radio" name="useCats" value="true" checked="checked"/> yes 
     5462            <input type="radio" name="useCats" value="false"/> no 
    53955463          </td> 
    53965464        </tr> 
  • trunk/deployment/webadmin/webapp/resources/resources/bedework.js

    r2130 r2131  
    242242  var hasACat = false; 
    243243 
    244   if (typeof formObj.catUid.length != 'undefined') { 
    245     for (i = 0; i < formObj.catUid.length; i++) { 
    246       if (formObj.catUid[i].checked) { 
     244  if (typeof formObj.defaultCategory.length != 'undefined') { 
     245    for (i = 0; i < formObj.defaultCategory.length; i++) { 
     246      if (formObj.defaultCategory[i].checked) { 
    247247        hasACat = true; 
    248248        break; 
     
    255255    // so we can clear the cats 
    256256    var hiddenCat = document.createElement("div"); 
    257     hiddenCat.innerHTML = '<input type="hidden" name="catUid" value=""/>'; 
     257    hiddenCat.innerHTML = '<input type="hidden" name="defaultCategory" value=""/>'; 
    258258    formObj.appendChild(hiddenCat); 
    259259  }