Changeset 460

Show
Ignore:
Timestamp:
05/05/06 15:39:08
Author:
johnsa
Message:

finishing up preferences form in user client; also changed values for transparency to be that of the iCal spec.

Files:

Legend:

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

    r457 r460  
    20862086          </td> 
    20872087          <td align="left"> 
    2088             <input type="radio" value="true" name="transparency"/> yes 
    2089             <input type="radio" value="false" name="transparency" checked="checked"/> no 
     2088            <input type="radio" value="OPAQUE" name="transparency"/> yes 
     2089            <input type="radio" value="TRANSPARENT" name="transparency" checked="checked"/> no 
    20902090          </td> 
    20912091        </tr> 
     
    33903390    <!-- The name "eventForm" is referenced by several javascript functions. Do not 
    33913391    change it without modifying includes.js --> 
    3392     <form name="eventForm" method="post" action="{$prefs-update}"
     3392    <form name="eventForm" method="post" action="{$prefs-update}" onSubmit="setWorkDays(this)"
    33933393      <table class="common"> 
    33943394        <tr><td colspan="2" class="fill">User settings:</td></tr> 
     
    34143414        <tr><td colspan="2">&#160;</td></tr> 
    34153415        <tr><td colspan="2" class="fill">Adding events:</td></tr> 
    3416         <tr> 
    3417           <td class="fieldname"> 
    3418             Default calendar: 
    3419           </td> 
    3420           <td> 
    3421             <xsl:variable name="newCalPath" select="defaultCalendar"/> 
    3422             <input type="hidden" name="newCalPath" value="{$newCalPath}"/> 
    3423             <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable> 
    3424             <span id="bwEventCalDisplay"> 
    3425               <xsl:choose> 
    3426                 <xsl:when test="contains(defaultCalendar,$userPath)"> 
    3427                   <xsl:value-of select="substring-after(defaultCalendar,$userPath)"/> 
    3428                 </xsl:when> 
    3429                 <xsl:otherwise> 
    3430                   <xsl:value-of select="defaultCalendar"/> 
    3431                 </xsl:otherwise> 
    3432               </xsl:choose> 
    3433             </span> 
    3434             <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a> 
    3435           </td> 
    3436         </tr> 
     3416        <!-- hide if only one calendar to select --> 
     3417        <xsl:if test="count(/bedework/myCalendars/calendars//calendar[currentAccess/current-user-privilege-set/privilege/write-content and calType = '1']) &gt; 1"> 
     3418          <tr> 
     3419            <td class="fieldname"> 
     3420              Default calendar: 
     3421            </td> 
     3422            <td> 
     3423              <xsl:variable name="newCalPath" select="defaultCalendar/path"/> 
     3424              <input type="hidden" name="newCalPath" value="{$newCalPath}"/> 
     3425              <xsl:variable name="userPath">user/<xsl:value-of select="/bedework/userid"/>/</xsl:variable> 
     3426              <span id="bwEventCalDisplay"> 
     3427                <xsl:choose> 
     3428                  <xsl:when test="contains(defaultCalendar,$userPath)"> 
     3429                    <xsl:value-of select="substring-after(defaultCalendar,$userPath)"/> 
     3430                  </xsl:when> 
     3431                  <xsl:otherwise> 
     3432                    <xsl:value-of select="defaultCalendar"/> 
     3433                  </xsl:otherwise> 
     3434                </xsl:choose> 
     3435              </span> 
     3436              <a href="javascript:launchCalSelectWindow('{$event-selectCalForEvent}')" class="small">[change]</a> 
     3437            </td> 
     3438          </tr> 
     3439        </xsl:if> 
    34373440        <tr> 
    34383441          <td class="fieldname"> 
     
    34693472            <xsl:variable name="workDays" select="workDays"/> 
    34703473            <input type="hidden" name="workDays" value="{$workDays}"/> 
    3471             <input type="checkbox" name="workDayIndex" value="0"/>Sun 
    3472             <input type="checkbox" name="workDayIndex" value="1"/>Mon 
    3473             <input type="checkbox" name="workDayIndex" value="2"/>Tue 
    3474             <input type="checkbox" name="workDayIndex" value="3"/>Wed 
    3475             <input type="checkbox" name="workDayIndex" value="4"/>Thu 
    3476             <input type="checkbox" name="workDayIndex" value="5"/>Fri 
    3477             <input type="checkbox" name="workDayIndex" value="6"/>Sat 
     3474            <xsl:choose> 
     3475              <xsl:when test="substring(workDays,1,1) = 'W'"> 
     3476                <input type="checkbox" name="workDayIndex" value="0" checked="checked"/>Sun 
     3477              </xsl:when> 
     3478              <xsl:otherwise> 
     3479                <input type="checkbox" name="workDayIndex" value="0"/>Sun 
     3480              </xsl:otherwise> 
     3481            </xsl:choose> 
     3482            <xsl:choose> 
     3483              <xsl:when test="substring(workDays,2,1) = 'W'"> 
     3484                <input type="checkbox" name="workDayIndex" value="1" checked="checked"/>Mon 
     3485              </xsl:when> 
     3486              <xsl:otherwise> 
     3487                <input type="checkbox" name="workDayIndex" value="1"/>Mon 
     3488              </xsl:otherwise> 
     3489            </xsl:choose> 
     3490            <xsl:choose> 
     3491              <xsl:when test="substring(workDays,3,1) = 'W'"> 
     3492                <input type="checkbox" name="workDayIndex" value="2" checked="checked"/>Tue 
     3493              </xsl:when> 
     3494              <xsl:otherwise> 
     3495                <input type="checkbox" name="workDayIndex" value="2"/>Tue 
     3496              </xsl:otherwise> 
     3497            </xsl:choose> 
     3498            <xsl:choose> 
     3499              <xsl:when test="substring(workDays,4,1) = 'W'"> 
     3500                <input type="checkbox" name="workDayIndex" value="3" checked="checked"/>Wed 
     3501              </xsl:when> 
     3502              <xsl:otherwise> 
     3503                <input type="checkbox" name="workDayIndex" value="3"/>Wed 
     3504              </xsl:otherwise> 
     3505            </xsl:choose> 
     3506            <xsl:choose> 
     3507              <xsl:when test="substring(workDays,5,1) = 'W'"> 
     3508                <input type="checkbox" name="workDayIndex" value="4" checked="checked"/>Thu 
     3509              </xsl:when> 
     3510              <xsl:otherwise> 
     3511                <input type="checkbox" name="workDayIndex" value="4"/>Thu 
     3512              </xsl:otherwise> 
     3513            </xsl:choose> 
     3514            <xsl:choose> 
     3515              <xsl:when test="substring(workDays,6,1) = 'W'"> 
     3516                <input type="checkbox" name="workDayIndex" value="5" checked="checked"/>Fri 
     3517              </xsl:when> 
     3518              <xsl:otherwise> 
     3519                <input type="checkbox" name="workDayIndex" value="5"/>Fri 
     3520              </xsl:otherwise> 
     3521            </xsl:choose> 
     3522            <xsl:choose> 
     3523              <xsl:when test="substring(workDays,7,1) = 'W'"> 
     3524                <input type="checkbox" name="workDayIndex" value="6" checked="checked"/>Sat 
     3525              </xsl:when> 
     3526              <xsl:otherwise> 
     3527                <input type="checkbox" name="workDayIndex" value="6"/>Sat 
     3528              </xsl:otherwise> 
     3529            </xsl:choose> 
    34783530          </td> 
    34793531        </tr> 
     
    34833535          </td> 
    34843536          <td> 
    3485             <xsl:variable name="workDayStart" select="workDayStart"/> 
    34863537            <select name="workDayStart"> 
    3487               <option value="0">00:00</option> 
    3488               <option value="30">00:30</option> 
    3489               <option value="60">01:00</option> 
    3490               <option value="90">01:30</option> 
    3491               <option value="120">02:00</option> 
    3492               <option value="150">02:30</option> 
    3493               <option value="180">03:00</option> 
    3494               <option value="210">03:30</option> 
    3495               <option value="240">04:00</option> 
    3496               <option value="270">04:30</option> 
    3497               <option value="300">05:00</option> 
    3498               <option value="330">05:30</option> 
    3499               <option value="360">06:00</option> 
    3500               <option value="390">06:30</option> 
    3501               <option value="420">07:00</option> 
    3502               <option value="450">07:30</option> 
    3503               <option value="480">08:00</option> 
    3504               <option value="510">08:30</option> 
    3505               <option value="540">09:00</option> 
    3506               <option value="570">09:30</option> 
    3507               <option value="600">10:00</option> 
    3508               <option value="630">10:30</option> 
    3509               <option value="660">11:00</option> 
    3510               <option value="690">11:30</option> 
    3511               <option value="720">12:00</option> 
    3512               <option value="750">12:30</option> 
    3513               <option value="780">13:00</option> 
    3514               <option value="810">13:30</option> 
    3515               <option value="840">14:00</option> 
    3516               <option value="870">14:30</option> 
    3517               <option value="900">15:00</option> 
    3518               <option value="930">15:30</option> 
    3519               <option value="960">16:00</option> 
    3520               <option value="990">16:30</option> 
    3521               <option value="1020">17:00</option> 
    3522               <option value="1050">17:30</option> 
    3523               <option value="1080">18:00</option> 
    3524               <option value="1110">18:30</option> 
    3525               <option value="1140">19:00</option> 
    3526               <option value="1170">19:30</option> 
    3527               <option value="1200">20:00</option> 
    3528               <option value="1230">20:30</option> 
    3529               <option value="1260">21:00</option> 
    3530               <option value="1290">21:30</option> 
    3531               <option value="1320">22:00</option> 
    3532               <option value="1350">22:30</option> 
    3533               <option value="1380">23:00</option> 
    3534               <option value="1410">23:30</option> 
     3538              <xsl:call-template name="buildWorkdayOptionsList"> 
     3539                <xsl:with-param name="selectedVal" select="workDayStart"/> 
     3540              </xsl:call-template> 
    35353541            </select> 
    35363542          </td> 
     
    35433549            <xsl:variable name="workDayEnd" select="workDayEnd"/> 
    35443550            <select name="workDayEnd"> 
    3545               <option value="0">00:00</option> 
    3546               <option value="30">00:30</option> 
    3547               <option value="60">01:00</option> 
    3548               <option value="90">01:30</option> 
    3549               <option value="120">02:00</option> 
    3550               <option value="150">02:30</option> 
    3551               <option value="180">03:00</option> 
    3552               <option value="210">03:30</option> 
    3553               <option value="240">04:00</option> 
    3554               <option value="270">04:30</option> 
    3555               <option value="300">05:00</option> 
    3556               <option value="330">05:30</option> 
    3557               <option value="360">06:00</option> 
    3558               <option value="390">06:30</option> 
    3559               <option value="420">07:00</option> 
    3560               <option value="450">07:30</option> 
    3561               <option value="480">08:00</option> 
    3562               <option value="510">08:30</option> 
    3563               <option value="540">09:00</option> 
    3564               <option value="570">09:30</option> 
    3565               <option value="600">10:00</option> 
    3566               <option value="630">10:30</option> 
    3567               <option value="660">11:00</option> 
    3568               <option value="690">11:30</option> 
    3569               <option value="720">12:00</option> 
    3570               <option value="750">12:30</option> 
    3571               <option value="780">13:00</option> 
    3572               <option value="810">13:30</option> 
    3573               <option value="840">14:00</option> 
    3574               <option value="870">14:30</option> 
    3575               <option value="900">15:00</option> 
    3576               <option value="930">15:30</option> 
    3577               <option value="960">16:00</option> 
    3578               <option value="990">16:30</option> 
    3579               <option value="1020">17:00</option> 
    3580               <option value="1050">17:30</option> 
    3581               <option value="1080">18:00</option> 
    3582               <option value="1110">18:30</option> 
    3583               <option value="1140">19:00</option> 
    3584               <option value="1170">19:30</option> 
    3585               <option value="1200">20:00</option> 
    3586               <option value="1230">20:30</option> 
    3587               <option value="1260">21:00</option> 
    3588               <option value="1290">21:30</option> 
    3589               <option value="1320">22:00</option> 
    3590               <option value="1350">22:30</option> 
    3591               <option value="1380">23:00</option> 
    3592               <option value="1410">23:30</option> 
     3551              <xsl:call-template name="buildWorkdayOptionsList"> 
     3552                <xsl:with-param name="selectedVal" select="workDayEnd"/> 
     3553              </xsl:call-template> 
    35933554            </select> 
    35943555          </td> 
     
    35963557        <tr><td colspan="2">&#160;</td></tr> 
    35973558        <tr><td colspan="2" class="fill">Display options:</td></tr> 
    3598         <tr> 
    3599           <td class="fieldname"> 
    3600             Preferred view: 
    3601           </td> 
    3602           <td> 
    3603             <xsl:variable name="preferredView" select="preferredView"/> 
    3604             <select name="preferredView"> 
    3605               <xsl:for-each select="/bedework/views/view"> 
    3606                 <xsl:variable name="viewName" select="name"/> 
    3607                 <xsl:choose> 
    3608                   <xsl:when test="viewName = $preferredView"> 
    3609                     <option value="{$viewName}" selected="selected"><xsl:value-of select="name"/></option> 
    3610                   </xsl:when> 
    3611                   <xsl:otherwise> 
    3612                     <option value="{$viewName}"><xsl:value-of select="name"/></option> 
    3613                   </xsl:otherwise> 
    3614                 </xsl:choose> 
    3615               </xsl:for-each> 
    3616             </select> 
    3617           </td> 
    3618         </tr> 
     3559        <xsl:if test="/bedework/views/view[position()=2]"> 
     3560          <!-- only display if there is more than one to select --> 
     3561          <tr> 
     3562            <td class="fieldname"> 
     3563              Preferred view: 
     3564            </td> 
     3565            <td> 
     3566              <xsl:variable name="preferredView" select="preferredView"/> 
     3567              <select name="preferredView"> 
     3568                <xsl:for-each select="/bedework/views/view"> 
     3569                  <xsl:variable name="viewName" select="name"/> 
     3570                  <xsl:choose> 
     3571                    <xsl:when test="viewName = $preferredView"> 
     3572                      <option value="{$viewName}" selected="selected"><xsl:value-of select="name"/></option> 
     3573                    </xsl:when> 
     3574                    <xsl:otherwise> 
     3575                      <option value="{$viewName}"><xsl:value-of select="name"/></option> 
     3576                    </xsl:otherwise> 
     3577                  </xsl:choose> 
     3578                </xsl:for-each> 
     3579              </select> 
     3580            </td> 
     3581          </tr> 
     3582        </xsl:if> 
    36193583        <tr> 
    36203584          <td class="fieldname"> 
     
    36683632          </td> 
    36693633        </tr> 
    3670         <tr> 
     3634        <!-- as you add skins, update this list and set the selected flag 
     3635                 as required; hide if not in use --> 
     3636        <!--<tr> 
    36713637          <td class="fieldname"> 
    36723638            Skin name: 
    36733639          </td> 
    36743640          <td> 
    3675             <!-- as you add skins, update this list and set the selected flag 
    3676                  as required (use an xsl:choose) --> 
    36773641            <xsl:variable name="skinName" select="skinName"/> 
    36783642            <select name="skin"> 
     
    36803644            </select> 
    36813645          </td> 
    3682         </tr> 
     3646        </tr> --> 
     3647        <!-- if you have skin styles, update this list and set the selected flag 
     3648                 as required; hide if not in use --> 
     3649        <!-- 
    36833650        <tr> 
    36843651          <td class="fieldname"> 
     
    36863653          </td> 
    36873654          <td> 
    3688             <!-- if you have skin styles, update this list and set the selected flag 
    3689                  as required (use an xsl:choose) --> 
    36903655            <xsl:variable name="skinStyle" select="skinStyle"/> 
    36913656            <select name="skinStyle"> 
     
    36933658            </select> 
    36943659          </td> 
    3695         </tr> 
    3696         <tr> 
     3660        </tr> --> 
     3661        <!-- hide if not in use: --> 
     3662        <!--<tr> 
    36973663          <td class="fieldname"> 
    36983664            Interface mode: 
     
    37273693            </select> 
    37283694          </td> 
    3729         </tr> 
     3695        </tr>--> 
    37303696      </table> 
    37313697      <br /> 
     
    37373703  </xsl:template> 
    37383704 
     3705  <!-- construct the workDay times options listings from minute 0 to less than 
     3706       minute 1440 (midnight inclusive); initialize the template with the currently 
     3707       selected value. Change the default value for "increment" here. minTime 
     3708       and maxTime are constants. --> 
     3709  <xsl:template name="buildWorkdayOptionsList"> 
     3710    <xsl:param name="selectedVal"/> 
     3711    <xsl:param name="increment" select="number(30)"/> 
     3712    <xsl:param name="currentTime" select="number(0)"/> 
     3713    <xsl:variable name="minTime" select="number(0)"/> 
     3714    <xsl:variable name="maxTime" select="number(1440)"/> 
     3715    <xsl:if test="$currentTime &lt; $maxTime"> 
     3716      <xsl:choose> 
     3717        <xsl:when test="$currentTime = $selectedVal"> 
     3718          <option value="{$currentTime}" selected="selected"> 
     3719            <xsl:if test="ceiling($currentTime div 60) &lt; 10">0</xsl:if><xsl:value-of select="ceiling($currentTime div 60)"/>:<xsl:if test="string-length($currentTime mod 60)=1">0</xsl:if><xsl:value-of select="$currentTime mod 60"/> 
     3720          </option> 
     3721        </xsl:when> 
     3722        <xsl:otherwise> 
     3723          <option value="{$currentTime}"> 
     3724            <xsl:if test="ceiling($currentTime div 60) &lt; 10">0</xsl:if><xsl:value-of select="ceiling($currentTime div 60)"/>:<xsl:if test="string-length($currentTime mod 60)=1">0</xsl:if><xsl:value-of select="$currentTime mod 60"/> 
     3725          </option> 
     3726        </xsl:otherwise> 
     3727      </xsl:choose> 
     3728      <xsl:call-template name="buildWorkdayOptionsList"> 
     3729        <xsl:with-param name="selectedVal" select="$selectedVal"/> 
     3730        <xsl:with-param name="currentTime" select="$currentTime + $increment"/> 
     3731      </xsl:call-template> 
     3732    </xsl:if> 
     3733  </xsl:template> 
    37393734 
    37403735  <!--==== SIDE CALENDAR MENU ====--> 
  • trunk/calendar3/deployment/webuser/webapp/resources/demoskins/default/default/errors.xsl

    r458 r460  
    3232      <xsl:when test="id='org.bedework.client.error.missingcalendarpath'"> 
    3333          <p>Missing calendar path (required).</p> 
     34      </xsl:when> 
     35      <xsl:when test="id='org.bedework.client.error.nosuchcalendar'"> 
     36          <p>No such calendar.</p> 
    3437      </xsl:when> 
    3538      <xsl:when test="id='org.bedework.client.error.duplicate.guid'"> 
  • trunk/calendar3/deployment/webuser/webapp/resources/demoskins/resources/includes.js

    r457 r460  
    9595    bwCalDisplay.innerHTML = calDisplay; 
    9696  } else { 
    97     alert("The event form is no longer available."); 
     97    alert("The event form is not available."); 
    9898  } 
    9999  window.close(); 
    100100} 
     101 
     102function setWorkDays(formObj) { 
     103  if (formObj) { 
     104    var workDays = ""; 
     105    for (i=0; i<7; i++) { 
     106      if (formObj.workDayIndex[i].checked) { 
     107        workDays += "W"; 
     108      } else { 
     109        workDays += " "; 
     110      } 
     111    } 
     112    formObj.workDays.value = workDays; 
     113  } else { 
     114    alert("The preferences form is not available."); 
     115  } 
     116} 
  • trunk/calendar3/webclient/war/WEB-INF/struts-config.xml

    r455 r460  
    694694               validate="false"> 
    695695      <forward name="cancelled" path="/showMain.rdo" redirect="true" /> 
    696       <forward name="retry" path="/prefs/showModForm.rdo" /> 
    697       <forward name="notFound" path="/prefs/showModForm.rdo" /> 
    698       <forward name="success" path="/showMain.rdo" redirect="true" /> 
     696      <forward name="retry" path="/prefs/showModForm.rdo" redirect="true"/> 
     697      <forward name="notFound" path="/prefs/showModForm.rdo" redirect="true"/> 
     698      <forward name="success" path="/prefs/showModForm.rdo" redirect="true" /> 
    699699    </action> 
    700700 
  • trunk/calendar3/webclient/war/docs/calendar/emitCalendar.jsp

    r433 r460  
    88  <bw:emitText name="calendar" property="path" /> 
    99  <bw:emitText name="calendar" property="encodedPath" /> 
     10  <calType><bean:write name="calendar" property="calType" /></calType> 
    1011  <bw:emitText name="calendar" property="description" tagName="desc" /> 
    1112  <calendarCollection><bean:write name="calendar" property="calendarCollection" /></calendarCollection> 
  • trunk/calendar3/webclient/war/docs/prefs/modPrefs.jsp

    r450 r460  
    2727  <workDays><bean:write name="userPrefs" property="workDays"/></workDays> 
    2828  <!-- start and end in minutes: e.g. 14:30 is 870 and 17:30 is 1050 --> 
    29   <workdayStart><bean:write name="userPrefs" property="workdayStart"/></workdayStart> 
    30   <workdayEnd><bean:write name="userPrefs" property="workdayEnd"/></workdayEnd> 
     29  <workDayStart><bean:write name="userPrefs" property="workdayStart"/></workDayStart> 
     30  <workDayEnd><bean:write name="userPrefs" property="workdayEnd"/></workDayEnd> 
    3131  <!-- pref end type = date or duration --> 
    3232  <preferredEndType><bean:write name="userPrefs" property="preferredEndType"/></preferredEndType> 
  • trunk/calendar3/webcommon/src/org/bedework/webcommon/pref/UpdatePrefsAction.java

    r459 r460  
    155155    } 
    156156 
    157     /* 
    158     str = getReqPar(request, "calPath"); 
     157    str = getReqPar(request, "newCalPath"); 
    159158    if (str != null) { 
    160159      BwCalendar cal = svc.getCalendar(str); 
     
    165164      prefs.setDefaultCalendar(cal); 
    166165    } 
    167     */ 
    168  
    169     /* user mode */ 
    170166 
    171167    int mode = getIntReqPar(request, "userMode", -1); 
     
    180176    } 
    181177 
    182     /* workdays */ 
     178    str = getReqPar(request, "workDays"); 
     179    if (str != null) { 
     180      // XXX validate 
     181      prefs.setWorkDays(str); 
     182    } 
    183183 
    184184    int minutes = getIntReqPar(request, "workDayStart", -1);