mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-14 17:58:51 +00:00
Added proper support for BYxxx recurrent masks.
See ChangeLog Monotone-Parent: 1388a39a062a16e073dca526237e1b25d5fa19d7 Monotone-Revision: 0e9f9326c164b5f5513aeb461785100c6c18fd0e Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2010-04-19T21:05:35 Monotone-Branch: ca.inverse.sogo
This commit is contained in:
@@ -241,32 +241,26 @@ function handleMonthlyRecurrence() {
|
||||
|
||||
var radioValue = $('recurrence_form').getRadioValue('monthlyRadioButtonName');
|
||||
|
||||
// FIXME - right now we do not support rules
|
||||
// such as The Second Tuesday...
|
||||
if (radioValue == 0)
|
||||
window.alert(recurrenceUnsupported);
|
||||
else {
|
||||
// We check if the monthlyMonthsField really contains an integer
|
||||
var showError = true;
|
||||
// We check if the monthlyMonthsField really contains an integer
|
||||
var showError = true;
|
||||
|
||||
var fieldValue = "" + $('monthlyMonthsField').value;
|
||||
if (fieldValue.length > 0) {
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
validate = true;
|
||||
showError = false;
|
||||
parent$("repeat1").value = fieldValue;
|
||||
parent$("repeat2").value = radioValue;
|
||||
parent$("repeat3").value = $('monthlyRepeat').value;
|
||||
parent$("repeat4").value = $('monthlyDay').value;
|
||||
parent$("repeat5").value = getSelectedDays("month");
|
||||
}
|
||||
var fieldValue = "" + $('monthlyMonthsField').value;
|
||||
if (fieldValue.length > 0) {
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
validate = true;
|
||||
showError = false;
|
||||
parent$("repeat1").value = fieldValue;
|
||||
parent$("repeat2").value = radioValue;
|
||||
parent$("repeat3").value = $('monthlyRepeat').value;
|
||||
parent$("repeat4").value = $('monthlyDay').value;
|
||||
parent$("repeat5").value = getSelectedDays("month");
|
||||
}
|
||||
|
||||
if (showError)
|
||||
window.alert(monthFieldInvalid);
|
||||
}
|
||||
|
||||
|
||||
if (showError)
|
||||
window.alert(monthFieldInvalid);
|
||||
|
||||
return validate;
|
||||
}
|
||||
|
||||
@@ -279,15 +273,20 @@ function validateYearlyRecurrence() {
|
||||
// We check if the yearlyYearsField really contains an integer
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
errorToShow = 1;
|
||||
fieldValue = "" + $('yearlyDayField').value;
|
||||
if (fieldValue.length > 0) {
|
||||
// We check if the yearlyYearsField really contains an integer
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
errorToShow = -1;
|
||||
var radioValue = $('recurrence_form').getRadioValue('yearlyRadioButtonName');
|
||||
if (radioValue == 0) {
|
||||
errorToShow = 1;
|
||||
fieldValue = "" + $('yearlyDayField').value;
|
||||
if (fieldValue.length > 0) {
|
||||
// We check if the yearlyDayField really contains an integer
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
errorToShow = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
errorToShow = -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -300,34 +299,28 @@ function validateYearlyRecurrence() {
|
||||
function handleYearlyRecurrence() {
|
||||
var validate = false;
|
||||
|
||||
var radioValue = $('recurrence_form').getRadioValue('yearlyRadioButtonName');
|
||||
// FIXME - right now we do not support rules
|
||||
// such as Every Second Tuesday of February
|
||||
if (radioValue == 1)
|
||||
window.alert(recurrenceUnsupported);
|
||||
else {
|
||||
if (validateYearlyRecurrence()) {
|
||||
var fieldValue = "" + $('yearlyYearsField').value;
|
||||
if (fieldValue.length > 0) {
|
||||
// We check if the yearlyYearsField really contains an integer
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
validate = true;
|
||||
showError = false;
|
||||
parent$("repeat1").value = fieldValue;
|
||||
parent$("repeat2").value = radioValue;
|
||||
parent$("repeat3").value = $('yearlyDayField').value;
|
||||
parent$("repeat4").value = $('yearlyMonth1').value;
|
||||
parent$("repeat5").value = $('yearlyRepeat').value;
|
||||
parent$("repeat6").value = $('yearlyDay').value;
|
||||
parent$("repeat7").value = $('yearlyMonth2').value;
|
||||
}
|
||||
if (validateYearlyRecurrence()) {
|
||||
var radioValue = $('recurrence_form').getRadioValue('yearlyRadioButtonName');
|
||||
var fieldValue = "" + $('yearlyYearsField').value;
|
||||
if (fieldValue.length > 0) {
|
||||
// We check if the yearlyYearsField (interval) really contains an integer
|
||||
var v = parseInt(fieldValue);
|
||||
if (!isNaN(v) && v > 0) {
|
||||
validate = true;
|
||||
showError = false;
|
||||
parent$("repeat1").value = fieldValue;
|
||||
parent$("repeat2").value = radioValue;
|
||||
parent$("repeat3").value = $('yearlyDayField').value;
|
||||
parent$("repeat4").value = $('yearlyMonth1').value;
|
||||
parent$("repeat5").value = $('yearlyRepeat').value;
|
||||
parent$("repeat6").value = $('yearlyDay').value;
|
||||
parent$("repeat7").value = $('yearlyMonth2').value;
|
||||
}
|
||||
}
|
||||
else
|
||||
validate = false;
|
||||
}
|
||||
|
||||
else
|
||||
validate = false;
|
||||
|
||||
return validate;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user