Changeset 2918
- Timestamp:
- 05/24/10 17:11:00
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/eventForm.xsl
r2913 r2918 426 426 <xsl:choose> 427 427 <xsl:when test="form/end/type='E'"> 428 <input type="radio" name="eventEndType" value="E" checked="checked" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>428 <input type="radio" name="eventEndType" id="eventEndTypeDateTime" value="E" checked="checked" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/> 429 429 </xsl:when> 430 430 <xsl:otherwise> 431 <input type="radio" name="eventEndType" value="E" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/>431 <input type="radio" name="eventEndType" id="eventEndTypeDateTime" value="E" onclick="changeClass('endDateTime','shown');changeClass('endDuration','invisible');"/> 432 432 </xsl:otherwise> 433 433 </xsl:choose> … … 520 520 <xsl:choose> 521 521 <xsl:when test="form/end/type='D'"> 522 <input type="radio" name="eventEndType" value="D" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>522 <input type="radio" name="eventEndType" id="eventEndTypeDuration" value="D" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/> 523 523 </xsl:when> 524 524 <xsl:otherwise> 525 <input type="radio" name="eventEndType" value="D" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/>525 <input type="radio" name="eventEndType" id="eventEndTypeDuration" value="D" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','shown');"/> 526 526 </xsl:otherwise> 527 527 </xsl:choose> … … 612 612 <xsl:choose> 613 613 <xsl:when test="form/end/type='N'"> 614 <input type="radio" name="eventEndType" value="N" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>614 <input type="radio" name="eventEndType" id="eventEndTypeNone" value="N" checked="checked" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/> 615 615 </xsl:when> 616 616 <xsl:otherwise> 617 <input type="radio" name="eventEndType" value="N" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/>617 <input type="radio" name="eventEndType" id="eventEndTypeNone" value="N" onclick="changeClass('endDateTime','invisible');changeClass('endDuration','invisible');"/> 618 618 </xsl:otherwise> 619 619 </xsl:choose> trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/javascript/bedeworkScheduling.js
r2913 r2918 102 102 } 103 103 } 104 } 105 } 104 }; 105 }; 106 106 107 107 /* A Freebusy object … … 163 163 } 164 164 return false; 165 } 166 } 165 }; 166 }; 167 167 168 168 /* Object to model the freebusy grid … … 238 238 this.display(); 239 239 } 240 } 240 }; 241 241 242 242 // add/update attendees … … 263 263 } 264 264 265 } 265 }; 266 266 267 267 this.removeAttendee = function(index) { 268 268 this.attendees.splice(index, 1); 269 269 this.requestFreeBusy(); 270 } 270 }; 271 271 272 272 this.requestFreeBusy = function() { … … 297 297 bwGrid.display(); 298 298 }); 299 } 299 }; 300 300 301 301 this.pickNext = function() { … … 325 325 // this flag lets us highlight the very first free time window on first click 326 326 pickNextClicked = true; 327 } 327 }; 328 328 329 329 this.pickPrevious = function() { … … 347 347 } 348 348 }); 349 } 349 }; 350 350 351 351 // create the lookup values for a free window for use with picknext/previous … … 369 369 } 370 370 } 371 } 371 }; 372 372 373 373 this.setIncrement = function(val) { 374 374 this.hourDivision = val; 375 375 this.display(); 376 } 377 378 this.display = function(width) { 376 }; 377 378 // The scheduling duration fields have been modified. 379 // Update the corresponding form elements and set the 380 // duration for selection in the grid. 381 this.bwSchedChangeDuration = function(inputId) { 382 var days = parseInt($("#durationDaysSched").val()); 383 var hours = parseInt($("#durationHoursSched").val()); 384 var mins = parseInt($("#durationMinutesSched").val()); 385 386 //do some form validation - make sure the durations are integers 387 if (isNaN(days) || isNaN(hours) || isNaN(mins)) { 388 alert("Please enter an integer value for durations.") 389 //$(inputId).focus(); // this doesn't work at the moment... 390 return false; 391 } 392 393 // force duration on the basic tab 394 $("#standardForm input[name='eventEndType']").val("D"); 395 $("#eventEndTypeDuration").attr("checked","checked"); 396 changeClass('endDateTime','invisible'); 397 changeClass('endDuration','shown'); 398 399 // set the basic tab's duration values 400 $("#durationDays").val(days); 401 $("#durationHours").val(hours); 402 $("#durationMinutes").val(mins); 403 404 // set the scheduling duration field values from the parsed values 405 // -- this strips any floating point values from user input 406 $("#durationDaysSched").val(days); 407 $("#durationHoursSched").val(hours); 408 $("#durationMinutesSched").val(mins); 409 410 // set the duration in the bwGrid and recalculate cells 411 durationMils = (days * 86400000) + (hours * 3600000) + (mins * 60000); 412 cellsInDuration = durationMils / incrementMils; 413 // repopulate the free time lookup 414 this.setFreeTime(); 415 }; 416 417 this.display = function() { 379 418 try { 380 419 // number of days to display … … 800 839 ); 801 840 802 // now add some actions 803 // to the elements of the freebusy control buttons ... 804 // while these are not actually part of the grid, the 805 // actions exposed interact with it 841 // now add some interactions between the freebusy control buttons, 842 // the scheduling widget, and the rest of the form. 806 843 807 844 $("#bwSchedOptions").click(function() { 808 alert("?");809 845 $("bwFbOptionsMenu").show("fast"); 846 }); 847 848 $("#durationDaysSched").change(function() { 849 bwGrid.bwSchedChangeDuration("#durationDaysSched"); 850 }); 851 852 $("#durationHoursSched").change(function() { 853 bwGrid.bwSchedChangeDuration("#durationHoursSched"); 854 }); 855 856 $("#durationMinutesSched").change(function() { 857 bwGrid.bwSchedChangeDuration("#durationMinutesSched"); 810 858 }); 811 859 … … 821 869 alert("Fb values:\n" + myString); 822 870 */ 823 } 824 } 871 }; 872 }; 825 873 826 874 // Utilities … … 829 877 // 86400000 is the number of milliseconds in a day; 830 878 return Math.round((Math.abs(startDate.getTime() - endDate.getTime())) / 86400000) 831 } 879 }; 832 880 833 881 // DATE PROTOTYPE OVERRIDES - should be pulled into a library … … 836 884 var m = ['January','February','March','April','May','June','July','August','September','October','November','December']; 837 885 return m[this.getMonth()]; 838 } 886 }; 839 887 Date.prototype.getDayName = function() { 840 888 var d = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday']; 841 889 return d[this.getDay()]; 842 } 890 }; 843 891 Date.prototype.addDays = function(days) { 844 892 this.setDate(this.getDate() + days); 845 } 893 }; 846 894 Date.prototype.addHours = function(hours) { 847 895 this.setHours(this.getHours() + hours); 848 } 896 }; 849 897 Date.prototype.addMinutes = function(minutes) { 850 898 this.setMinutes(this.getMinutes() + minutes); 851 } 899 }; 852 900 // return a twelve-hour hour 853 901 Date.prototype.getHours12 = function() { … … 857 905 } 858 906 return hours12; 859 } 907 }; 860 908 // prepend minutes with zero if needed 861 909 Date.prototype.getMinutesFull = function() { … … 865 913 } 866 914 return hours12; 867 } 915 }; 868 916 869 917 /* UTC FORMATTERS */ … … 876 924 } 877 925 return monthFull; 878 } 926 }; 879 927 // return a formatted UTC day date, prepended with zero if needed 880 928 Date.prototype.getUTCDateFull = function() { … … 884 932 } 885 933 return dateFull; 886 } 934 }; 887 935 // return formatted UTC hours, prepended with zero if needed 888 936 Date.prototype.getUTCHoursFull = function() { … … 892 940 } 893 941 return hoursFull; 894 } 942 }; 895 943 // return formatted UTC minutes, prepended with zero if needed 896 944 Date.prototype.getUTCMinutesFull = function() { … … 900 948 } 901 949 return minutesFull; 902 } 950 }; 903 951 904 952 /*
