Changeset 1151

Show
Ignore:
Timestamp:
12/13/06 01:54:32
Author:
johnsa
Message:

personal client: more work on recurrence form interface. Can now submit recurrences for days and weeks; interval, byday, count, and until values are accounted for. Month and year recurrence form elements in place (but not yet fully functional).

Files:

Legend:

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

    r1146 r1151  
    681681  padding: 0; 
    682682} 
     683#recurrenceFields #monthRecurFields div, 
     684#recurrenceFields #yearRecurFields div { 
     685  display: block; 
     686  margin: 0 0 0.5em 0; 
     687} 
     688#recurrenceFields #yearMonthCheckBoxList, 
     689#recurrenceFields #yearMonthDaysCheckBoxList, 
     690#recurrenceFields #yearDaysCheckBoxList { 
     691  margin: 0.5em 0 0.5em 2em; 
     692  display: block; 
     693  clear: both; 
     694} 
    683695.shown { 
    684696  display: inline; 
    685697} 
    686698.invisible { 
    687   display: none
     699  display: none !important
    688700} 
    689701.hidden { 
  • trunk/deployment/webuser/webapp/resources/demoskins/default/default/default.xsl

    r1150 r1151  
    975975        <xsl:when test="recurring='true'"> 
    976976          Edit: 
    977           <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    978             master event 
    979           </a> 
    980           <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    981             this instance 
    982           </a> 
     977          <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">master</a>, 
     978          <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">instance</a> 
     979          <br/> 
    983980        </xsl:when> 
    984981        <xsl:otherwise> 
    985           <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    986             Edit 
    987           </a> 
     982          <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">Edit</a> 
     983          | 
    988984        </xsl:otherwise> 
    989985      </xsl:choose> 
    990       | 
    991986    </xsl:if> 
    992987    <xsl:if test="owner != /bedework/userid"> 
     
    995990          Annotate: 
    996991          <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    997             master event 
     992            master 
     993          </a>, 
     994          <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
     995            this 
    998996          </a> 
    999           <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    1000             this instance 
    1001           </a> 
     997          <br/> 
    1002998        </xsl:when> 
    1003999        <xsl:otherwise> 
     
    10051001            Annotate 
    10061002          </a> 
     1003          | 
    10071004        </xsl:otherwise> 
    10081005      </xsl:choose> 
    1009       | 
    10101006    </xsl:if> 
    10111007    <xsl:if test="owner != /bedework/userid"> 
     
    10211017        <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    10221018          all 
    1023         </a> 
     1019        </a>, 
    10241020        <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    1025           this instance 
     1021          instance 
    10261022        </a> 
    10271023      </xsl:when> 
     
    13271323                  <img src="{$resourcesRoot}/resources/std-ical_iconEditDkGray.gif" width="12" height="16" border="0" alt="edit master"/> 
    13281324                  Edit: 
    1329                   <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    1330                     master event 
    1331                   </a> 
    1332                   <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    1333                     this instance 
    1334                   </a> 
     1325                  <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">master</a>,<a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">instance</a> 
    13351326                </xsl:when> 
    13361327                <xsl:otherwise> 
     
    13481339                  <img src="{$resourcesRoot}/resources/std-ical_iconEditDkGray.gif" width="12" height="16" border="0" alt="edit master"/> 
    13491340                  Annotate: 
    1350                   <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    1351                     master event 
    1352                   </a> 
    1353                   <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    1354                     this instance 
    1355                   </a> 
     1341                  <a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">master</a>,<a href="{$editEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">instance</a> 
    13561342                </xsl:when> 
    13571343                <xsl:otherwise> 
     
    13761362                <img src="{$resourcesRoot}/resources/trashIcon.gif" width="13" height="13" border="0" alt="delete all"/> 
    13771363                Delete: 
    1378                 <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}"> 
    1379                   all 
    1380                 </a> 
    1381                 <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}"> 
    1382                   this instance 
    1383                 </a> 
     1364                <a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}">all</a>,<a href="{$delEvent}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">instance</a> 
    13841365              </xsl:when> 
    13851366              <xsl:otherwise> 
     
    22112192          <!-- ================= --> 
    22122193          <input type="checkbox" name="recurrenceFlag" onclick="swapRecurrence(this)" value="on"/> 
    2213           <!-- set these dynamically --> 
     2194          <!-- set these dynamically when form is submitted --> 
    22142195          <input type="hidden" name="interval" value=""/> 
    22152196          <input type="hidden" name="count" value=""/> 
     
    22272208                <td class="recurrenceFrequency" rowspan="2"> 
    22282209                  <strong>Frequency:</strong><br/> 
    2229                   <!-- "freq" is used to determine if a recurrence should be created; test for "none" --> 
     2210                  <!-- "freq" is used to determine if a recurrence should be created; test for "NONE" --> 
    22302211                  <input type="radio" name="freq" value="NONE" onclick="showRecurrence(this.value)" checked="checked"/>none<br/> 
    22312212                  <!--<input type="radio" name="freq" value="HOURLY" onclick="showRecurrence(this.value)"/>hourly<br/>--> 
     
    22592240                    </p> 
    22602241                    <p> 
    2261                       <div id="byDayWeek"> 
     2242                      <div id="weekRecurFields"> 
    22622243                        <xsl:call-template name="byDayChkBoxList"> 
    22632244                          <xsl:with-param name="name">byDayWeek</xsl:with-param> 
     
    22662247                    </p> 
    22672248                    <p align="right"> 
    2268                       <a href="javascript:recurSelectWeekdays('byDayWeek')">select weekdays</a> | 
    2269                       <a href="javascript:recurSelectWeekends('byDayWeek')">select weekends</a> 
     2249                      <a href="javascript:recurSelectWeekdays('weekRecurFields')">select weekdays</a> | 
     2250                      <a href="javascript:recurSelectWeekends('weekRecurFields')">select weekends</a> 
    22702251                    </p> 
    22712252                  </div> 
     
    22762257                      every <input type="text" name="monthlyInterval" size="2" value="1"/> month(s) 
    22772258                    </p> 
     2259                    <div id="monthRecurFields"> 
     2260                      <div id="monthRecurFields1"> 
     2261                        on 
     2262                        <select name="bymonthposPos1" width="7em" onchange="revealNextRecurField(this,'monthRecurFields2')"> 
     2263                          <xsl:call-template name="recurrenceDayPosOptions"/> 
     2264                        </select> 
     2265                        <xsl:call-template name="byDayChkBoxList"/> 
     2266                      </div> 
     2267                      <xsl:call-template name="buildRecurFields"> 
     2268                        <xsl:with-param name="current">2</xsl:with-param> 
     2269                        <xsl:with-param name="total">10</xsl:with-param> 
     2270                        <xsl:with-param name="name">month</xsl:with-param> 
     2271                      </xsl:call-template> 
     2272                    </div> 
    22782273                    <p> 
    2279                       &#160;on 
    2280                       <select name="bymonthposPos1" width="7em"> 
    2281                         <xsl:call-template name="recurrenceDayPosOptions"/> 
    2282                       </select> 
    2283                       <xsl:call-template name="byDayChkBoxList"/><br/> 
    2284                       and 
    2285                       <select name="bymonthposPos2" width="7em"> 
    2286                         <xsl:call-template name="recurrenceDayPosOptions"/> 
    2287                       </select> 
    2288                       <xsl:call-template name="byDayChkBoxList"/><br/> 
    2289                       and 
    2290                       <select name="bymonthposPos3" width="7em"> 
    2291                         <xsl:call-template name="recurrenceDayPosOptions"/> 
    2292                       </select> 
    2293                       <xsl:call-template name="byDayChkBoxList"/><br/> 
    2294                       and 
    2295                       <select name="bymonthposPos4" width="7em"> 
    2296                         <xsl:call-template name="recurrenceDayPosOptions"/> 
    2297                       </select> 
    2298                       <xsl:call-template name="byDayChkBoxList"/> 
    2299                     </p> 
    2300                     <p> 
    2301                       <input type="checkbox" name="swapMonthCheckBoxList" value="" onclick="swapVisible(this,'monthCheckBoxList')"/> 
     2274                      <input type="checkbox" name="swapMonthDaysCheckBoxList" value="" onclick="swapVisible(this,'monthDaysCheckBoxList')"/> 
    23022275                      on these days:<br/> 
    2303                       <div id="monthCheckBoxList" class="invisible"> 
     2276                      <div id="monthDaysCheckBoxList" class="invisible"> 
    23042277                        <xsl:call-template name="buildCheckboxList"> 
    23052278                          <xsl:with-param name="current">1</xsl:with-param> 
    23062279                          <xsl:with-param name="end">31</xsl:with-param> 
    2307                           <xsl:with-param name="name">bymonthdayBoxes</xsl:with-param> 
     2280                          <xsl:with-param name="name">monthDayBoxes</xsl:with-param> 
    23082281                        </xsl:call-template> 
    23092282                      </div> 
    23102283                    </p> 
    23112284                  </div> 
     2285                  <!-- yearly --> 
    23122286                  <div id="yearlyRecurrenceRules" class="invisible"> 
    23132287                    <strong>Interval:</strong> 
    23142288                    every <input type="text" name="monthlyInterval" size="2" value="1"/> years(s)<br/> 
    2315                     <p> 
    2316                       <input type="radio" name="yearrrule" value="bymonthpos" onclick="swapYearCheckBoxList(this)" checked="checked"/> 
    2317                        on 
    2318                       <select name="bymonthposPos1" width="7em"> 
    2319                         <xsl:call-template name="recurrenceDayPosOptions"/> 
    2320                       </select> 
    2321                       <select name="bymonthposDay1" width="7em"> 
    2322                         <xsl:for-each select="/bedework/daynames/val"> 
    2323                           <option> 
    2324                             <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2325                             <xsl:value-of select="."/> 
    2326                           </option> 
    2327                         </xsl:for-each> 
    2328                       </select> of 
    2329                       <select name="bymonthposMonth1" width="7em"> 
    2330                         <xsl:for-each select="/bedework/monthvalues/val"> 
    2331                           <option> 
    2332                             <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2333                             <xsl:variable name="pos" select="position()"/> 
    2334                             <xsl:value-of select="/bedework/monthlabels/val[position() = $pos]"/> 
    2335                           </option> 
    2336                         </xsl:for-each> 
    2337                       </select> 
    2338                       <div class="extraByMonthPosFields"> 
    2339                         and 
    2340                         <select name="bymonthposPos2" width="7em"> 
     2289                    <div id="yearRecurFields"> 
     2290                      <div id="yearRecurFields1"> 
     2291                        on 
     2292                        <select name="byyearposPos1" width="7em" onchange="revealNextRecurField(this,'yearRecurFields2')"> 
    23412293                          <xsl:call-template name="recurrenceDayPosOptions"/> 
    23422294                        </select> 
    2343                         <select name="bymonthposDay2" width="7em"> 
    2344                           <xsl:for-each select="/bedework/daynames/val"> 
    2345                             <option> 
    2346                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2347                               <xsl:value-of select="."/> 
    2348                             </option> 
    2349                           </xsl:for-each> 
    2350                         </select> of 
    2351                         <select name="bymonthposMonth2" width="7em"> 
    2352                           <xsl:for-each select="/bedework/monthvalues/val"> 
    2353                             <option> 
    2354                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2355                               <xsl:variable name="pos" select="position()"/> 
    2356                               <xsl:value-of select="/bedework/monthlabels/val[position() = $pos]"/> 
    2357                             </option> 
    2358                           </xsl:for-each> 
    2359                         </select><br/> 
    2360                         and 
    2361                         <select name="bymonthposPos3" width="7em"> 
    2362                           <xsl:call-template name="recurrenceDayPosOptions"/> 
    2363                         </select> 
    2364                         <select name="bymonthposDay3" width="7em"> 
    2365                           <option value="none">none</option> 
    2366                           <xsl:for-each select="/bedework/daynames/val"> 
    2367                             <option> 
    2368                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2369                               <xsl:value-of select="."/> 
    2370                             </option> 
    2371                           </xsl:for-each> 
    2372                         </select> of 
    2373                         <select name="bymonthposMonth3" width="7em"> 
    2374                           <xsl:for-each select="/bedework/monthvalues/val"> 
    2375                             <option> 
    2376                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2377                               <xsl:variable name="pos" select="position()"/> 
    2378                               <xsl:value-of select="/bedework/monthlabels/val[position() = $pos]"/> 
    2379                             </option> 
    2380                           </xsl:for-each> 
    2381                         </select><br/> 
    2382                         and 
    2383                         <select name="bymonthposPos4" width="7em"> 
    2384                           <xsl:call-template name="recurrenceDayPosOptions"/> 
    2385                         </select> 
    2386                         <select name="bymonthposDay4" width="7em"> 
    2387                           <xsl:for-each select="/bedework/daynames/val"> 
    2388                             <option> 
    2389                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2390                               <xsl:value-of select="."/> 
    2391                             </option> 
    2392                           </xsl:for-each> 
    2393                         </select> of 
    2394                         <select name="bymonthposMonth4" width="7em"> 
    2395                           <xsl:for-each select="/bedework/monthvalues/val"> 
    2396                             <option> 
    2397                               <xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute> 
    2398                               <xsl:variable name="pos" select="position()"/> 
    2399                               <xsl:value-of select="/bedework/monthlabels/val[position() = $pos]"/> 
    2400                             </option> 
    2401                           </xsl:for-each> 
    2402                         </select> 
     2295                        <xsl:call-template name="byDayChkBoxList"/> 
     2296                      </div> 
     2297                      <xsl:call-template name="buildRecurFields"> 
     2298                        <xsl:with-param name="current">2</xsl:with-param> 
     2299                        <xsl:with-param name="total">10</xsl:with-param> 
     2300                        <xsl:with-param name="name">year</xsl:with-param> 
     2301                      </xsl:call-template> 
     2302                    </div> 
     2303                    <p> 
     2304                      <input type="checkbox" name="swapYearMonthCheckBoxList" value="" onclick="swapVisible(this,'yearMonthCheckBoxList')"/> 
     2305                      in these months: 
     2306                      <div id="yearMonthCheckBoxList" class="invisible"> 
     2307                        <xsl:for-each select="/bedework/monthlabels/val"> 
     2308                          <xsl:variable name="pos"><xsl:value-of select="position()"/></xsl:variable> 
     2309                          <span class="chkBoxListItem"> 
     2310                            <input type="checkbox" name="yearMonths"> 
     2311                              <xsl:attribute name="value"><xsl:value-of select="/bedework/monthvalues/val[position() = $pos]"/></xsl:attribute> 
     2312                            </input> 
     2313                            <xsl:value-of select="."/> 
     2314                          </span> 
     2315                          <xsl:if test="$pos mod 6 = 0"><br/></xsl:if> 
     2316                        </xsl:for-each> 
    24032317                      </div> 
    24042318                    </p> 
    24052319                    <p> 
    2406                       <input type="checkbox" name="swapYearCheckBoxList" value="" onclick="swapVisible(this,'yearCheckBoxList')"/>on these days of the year:<br/> 
    2407                       <div id="yearCheckBoxList" class="invisible"> 
     2320                      <input type="checkbox" name="swapYearMonthDaysCheckBoxList" value="" onclick="swapVisible(this,'yearMonthDaysCheckBoxList')"/> 
     2321                      on these days of the month:<br/> 
     2322                      <div id="yearMonthDaysCheckBoxList" class="invisible"> 
     2323                        <xsl:call-template name="buildCheckboxList"> 
     2324                          <xsl:with-param name="current">1</xsl:with-param> 
     2325                          <xsl:with-param name="end">31</xsl:with-param> 
     2326                          <xsl:with-param name="name">yearMonthDayBoxes</xsl:with-param> 
     2327                        </xsl:call-template> 
     2328                      </div> 
     2329                    </p> 
     2330                    <p> 
     2331                      <input type="checkbox" name="swapYearDaysCheckBoxList" value="" onclick="swapVisible(this,'yearDaysCheckBoxList')"/> 
     2332                      on these days of the year:<br/> 
     2333                      <div id="yearDaysCheckBoxList" class="invisible"> 
    24082334                        <xsl:call-template name="buildCheckboxList"> 
    24092335                          <xsl:with-param name="current">1</xsl:with-param> 
    24102336                          <xsl:with-param name="end">366</xsl:with-param> 
    2411                           <xsl:with-param name="name">byyeardayBoxes</xsl:with-param> 
     2337                          <xsl:with-param name="name">yearDayBoxes</xsl:with-param> 
    24122338                        </xsl:call-template> 
    24132339                      </div> 
     
    24162342                </td> 
    24172343              </tr> 
     2344              <!-- recurrence count, until, forever --> 
    24182345              <tr> 
    24192346                <td class="recurrenceUntil"> 
     
    24222349                     <p> 
    24232350                       <div class="dateFields"> 
    2424                          <input type="radio" name="rCountUntil" value="until"/> 
     2351                         <input type="radio" name="recurCountUntil" value="until" id="recurUntil"/> 
    24252352                         until 
    2426                          <select name="untilMonth"
     2353                         <select name="untilMonth" onchange="selectRecurCountUntil('recurUntil')"
    24272354                           <xsl:for-each select="form/start/month/select/option"> 
    24282355                             <xsl:copy-of select="."/> 
    24292356                           </xsl:for-each> 
    24302357                         </select> 
    2431                          <select name="untilDay"
     2358                         <select name="untilDay" onchange="selectRecurCountUntil('recurUntil')"
    24322359                           <xsl:for-each select="form/start/day/select/option"> 
    24332360                             <xsl:copy-of select="."/> 
     
    24362363                         <xsl:choose> 
    24372364                          <xsl:when test="/bedework/creating = 'true'"> 
    2438                              <select name="untilYear"
     2365                             <select name="untilYear" onchange="selectRecurCountUntil('recurUntil')"
    24392366                               <xsl:for-each select="form/start/year/select/option"> 
    24402367                                 <xsl:copy-of select="."/> 
     
    24432370                          </xsl:when> 
    24442371                          <xsl:otherwise> 
    2445                             <input type="text" name="untilYear" size="4"/> 
     2372                            <input type="text" name="untilYear" size="4"  onchange="selectRecurCountUntil('recurUntil')"/> 
    24462373                            <xsl:attribute name="value"><xsl:value-of select="form/start/yearText/input/@value"/></xsl:attribute> 
    24472374                          </xsl:otherwise> 
     
    24552382                     </p> 
    24562383                     <p> 
    2457                        <input type="radio" name="rCountUntil" value="forever" checked="checked"/> 
     2384                       <input type="radio" name="recurCountUntil" value="forever" checked="checked"/> 
    24582385                       forever 
    24592386                       &#160; 
    2460                        <input type="radio" name="rCountUntil" value="count"/> 
    2461                        <input type="text" value="1" size="2" name="count"/> times 
     2387                       <input type="radio" name="recurCountUntil" value="count" id="recurCount"/> 
     2388                       <input type="text" value="1" size="2" name="countHolder"  onchange="selectRecurCountUntil('recurCount')"/> times 
    24622389                     </p> 
    24632390                   </div> 
     
    26452572    </span> 
    26462573    <xsl:if test="$current mod $splitter = 0"><br/></xsl:if> 
     2574    <xsl:if test="$current = $end"><br/></xsl:if> 
    26472575    <xsl:if test="$current &lt; $end"> 
    26482576      <xsl:call-template name="buildCheckboxList"> 
     
    26632591    <option value="-1">the last</option> 
    26642592    <option value="">every</option> 
     2593  </xsl:template> 
     2594 
     2595  <xsl:template name="buildRecurFields"> 
     2596    <xsl:param name="current"/> 
     2597    <xsl:param name="total"/> 
     2598    <xsl:param name="name"/> 
     2599    <div class="invisible"> 
     2600      <xsl:attribute name="id"><xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current"/></xsl:attribute> 
     2601      and 
     2602      <select width="12em"> 
     2603        <xsl:attribute name="name">by<xsl:value-of select="$name"/>posPos<xsl:value-of select="$current"/></xsl:attribute> 
     2604        <xsl:if test="$current != $total"> 
     2605          <xsl:attribute name="onchange">revealNextRecurField(this,'<xsl:value-of select="$name"/>RecurFields<xsl:value-of select="$current+1"/>')</xsl:attribute> 
     2606        </xsl:if> 
     2607        <xsl:call-template name="recurrenceDayPosOptions"/> 
     2608      </select> 
     2609      <xsl:call-template name="byDayChkBoxList"/> 
     2610    </div> 
     2611    <xsl:if test="$current &lt; $total"> 
     2612      <xsl:call-template name="buildRecurFields"> 
     2613        <xsl:with-param name="current"><xsl:value-of select="$current+1"/></xsl:with-param> 
     2614        <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param> 
     2615        <xsl:with-param name="name"><xsl:value-of select="$name"/></xsl:with-param> 
     2616      </xsl:call-template> 
     2617    </xsl:if> 
    26652618  </xsl:template> 
    26662619 
  • trunk/deployment/webuser/webapp/resources/demoskins/resources/includes.js

    r1150 r1151  
    154154  } 
    155155} 
    156 // assemble the recurrence rules if recurrence is specified 
    157 function setRecurrence(form) { 
    158   if (form.recurrenceFlag.checked) { 
    159  
    160   } 
     156// reveal the next recurrence field set if the selected value isn't 0 ('none') 
     157function revealNextRecurField(obj,id) { 
     158  if (obj.value != '0') { 
     159    changeClass(id,'shown'); 
     160  } 
     161
     162function selectRecurCountUntil(id) { 
     163  document.getElementById(id).checked = true; 
     164
     165// Assemble the recurrence rules if recurrence is specified. 
     166// Request params to set ('freq' is always set): 
     167// interval, count, until (count OR until, not both) 
     168// possibly: byday, bymonthday, bymonth, byyearday 
     169function setRecurrence(formObj) { 
     170  if (formObj.recurrenceFlag.checked) { 
     171    var freq = getSelectedRadioButtonVal(formObj.freq); 
     172    if (freq != 'NONE') { 
     173      // build up recurrence rules 
     174      switch (freq) { 
     175        case "DAILY": 
     176          formObj.interval.value = formObj.dailyInterval.value; 
     177          break; 
     178        case "WEEKLY": 
     179          formObj.interval.value = formObj.weeklyInterval.value; 
     180          weekByDayChkBoxes = document.getElementById('weekRecurFields').getElementsByTagName('input'); 
     181          formObj.byday.value = collectRecurChkBoxVals(weekByDayChkBoxes); 
     182          break; 
     183        case "MONTHLY": 
     184          formObj.interval.value = formObj.monthlyInterval.value; 
     185          break; 
     186        case "YEARLY": 
     187          formObj.interval.value = formObj.yearlyInterval.value; 
     188          break; 
     189      } 
     190      // build up count or until values 
     191      var recur = getSelectedRadioButtonVal(formObj.recurCountUntil); 
     192      switch (recur) { 
     193        case "forever": 
     194          // do nothing 
     195          break; 
     196        case "count": 
     197          formObj.count.value = formObj.countHolder.value; 
     198          break; 
     199        case "until": 
     200          // pad the month and day with zeros if only a single digit 
     201          var paddedMonth = (formObj.untilMonth.value < 10) ? '0'+formObj.untilMonth.value : formObj.untilMonth.value; 
     202          var paddedDay = (formObj.untilDay.value < 10) ? '0'+formObj.untilDay.value : formObj.untilDay.value; 
     203          formObj.until.value = formObj.untilYear.value + paddedMonth + paddedDay; 
     204          break; 
     205      } 
     206    } 
     207  } 
     208  alert("frequency: " + freq + "\ninterval: " + formObj.interval.value + "\ncount: " + formObj.count.value + "\nuntil: " + formObj.until.value + "\nbyday: " + formObj.byday.value + "\nbymonthday" + formObj.bymonthday.value + "\nbymonth" + formObj.bymonth.value + "\nbyyearday" + formObj.byyearday.value + "\n"); 
     209  return true; 
     210
     211function getSelectedRadioButtonVal(radioCollection) { 
     212  for(var i = 0; i < radioCollection.length; i++) { 
     213    if(radioCollection[i].checked == true) { 
     214       return radioCollection[i].value; 
     215    } 
     216  } 
     217
     218function collectRecurChkBoxVals(chkBoxes) { 
     219  var collectedVals = ""; 
     220  if (chkBoxes) { 
     221    if (typeof chkBoxes.length != 'undefined') { 
     222      for (i = 0; i < chkBoxes.length; i++) { 
     223        if (chkBoxes[i].checked == true) { 
     224           collectedVals += chkBoxes[i].value + ','; 
     225        } 
     226      } 
     227    } 
     228  } 
     229  return collectedVals; 
    161230} 
    162231// launch a simple window for displaying information; no header or status bar 
     
    181250 
    182251function startDateCalWidgetCallback(date, month, year) { 
    183   if (String(month).length == 1) { 
     252  /*if (String(month).length == 1) { 
    184253      month = '0' + month; 
    185254  } 
    186255  if (String(date).length == 1) { 
    187256      date = '0' + date; 
    188   } 
     257  }*/ 
    189258  document.eventForm['eventStartDate.month'].value = month; 
    190259  document.eventForm['eventStartDate.day'].value = date; 
     
    192261} 
    193262function endDateCalWidgetCallback(date, month, year) { 
    194   if (String(month).length == 1) { 
     263  /*if (String(month).length == 1) { 
    195264      month = '0' + month; 
    196265  } 
    197266  if (String(date).length == 1) { 
    198267      date = '0' + date; 
    199   } 
     268  }*/ 
    200269 
    201270  document.eventForm['eventEndDate.month'].value = month; 
     
    204273} 
    205274function untilDateCalWidgetCallback(date, month, year) { 
    206   if (String(month).length == 1) { 
     275  /*if (String(month).length == 1) { 
    207276      month = '0' + month; 
    208277  } 
    209278  if (String(date).length == 1) { 
    210279      date = '0' + date; 
    211   } 
     280  }*/ 
    212281 
    213282  document.eventForm['untilMonth'].value = month; 
    214283  document.eventForm['untilDay'].value = date; 
    215284  document.eventForm['untilYear'].value = year; 
     285  selectRecurCountUntil('recurUntil'); 
    216286} 
    217287