Closed Bug 263539 Opened 20 years ago Closed 20 years ago

todo dialog: Prevent task alarm trigger with no trigger date

Categories

(Calendar :: Sunbird Only, defect)

defect
Not set
minor

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: gekacheka, Assigned: mostafah)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; rv:1.7.3) Gecko/20040913 Firefox/0.10.1
Build Identifier: Sunbird 0.2a

A common error seems to be to create a task with a due date and no start date,
and an alarm that triggers off the start date.  (Or possibly vice versa, a task
with a start date and no due date that triggers off the due date.)  See for
example bug 257714, bug 257943, or bug 258809.

There are two parts to this problem:  
1. The task dialog needs to be adjusted so the user can't make this error.
2. the back end should be fixed so it doesn't crash on files with this error.
This bug is about the task dialog.

The task dialog should:
A. If no start or due date is set, then it should disable the alarm option.
B. If just one of start date or due date is set, then it should automatically
choose it as the trigger, and disable the choice.
C. If both start date and due date are set, then the user can make a choice.


Reproducible: Always
Steps to Reproduce:
Changes:

onDateTimeCheckbox: 
  updateAlarmItemEnabled when start or due checkbox changes.

updateAlarmItemEnabled:  
  If neither start nor due date checked, disabled alarm checkbox.
  If alarm checkbox disabled, uncheck it.
  For non-trigger-choice widgets, disabled iff alarm checkbox off.
  For trigger-choice menulist:
    if exactly one date checked, select it as trigger.
    iff alarm checked and both dates checked, enable trigger choice.

menuListFieldSelectItem: 
  added to select menuList item by value

setFieldValue:	
  added comment removed from updateAlarmItemEnabled
See comment #1.  (removed 1 irrelevant hunk.)
Attachment #161533 - Attachment is obsolete: true
Comment on attachment 161534 [details] [diff] [review]
toDoDialog.js patch: constrain alarm trigger options

Tested on Sunbird 0.2a (Moz1.8), Moz1.7.3:
0:New Task, title "constrain triggers test"
    start date checkbox enabled but unchecked, start date picker disabled
    due date checkbox enabled but unchecked, due date picker disabled.
    alarm checkbox disabled and unchecked, options all disabled

1:set due date checkbox to checked (start is unchecked)
    alarm checkbox enabled
    alarm options remain disabled
    alarm trigger menulist changes to "before due", remains disabled.

 1a:set alarm checkbox to checked
      alarm options are enabled
      alarm trigger menulist remains disabled (no choice)

 1b:click ok

 1c:double click task "constrain triggers test"
      reloaded same state

 1d:set due date checkbox to unchecked (both dates are unchecked)
      alarm checkbox is disabled
      alarm checkbox becomes unchecked
      alarm options are disabled

2:set start date checkbox to checked (due is unchecked)
    alarm checkbox enabled
    alarm options remain disabled
    alarm trigger menulist changes to "before start", remains disabled.

 2a:set alarm checkbox to checked
      alarm options are enabled
      alarm trigger menulist remains disabled (no choice)

 2b:set due date checkbox to unchecked
      alarm checkbox is disabled, becomes unchecked
      alarm options are disabled

3:set both start and due date checkboxes to checked in that order
    alarm checkbox enabled
    alarm options remain disabled
    alarm trigger menulist stays on "before start", remains disabled.

  3a:set alarm checkbox to checked
      alarm options are enabled
      alarm trigger menulist becomes enabled (choice!)

  3b:set start date checkbox to unchecked (due date stays checked)
      alarm checkbox remains checked, enabled
      alarm options remain enabled
      alarm trigger menulist changes to "before due", 
      alarm trigger menulist becomes disabled (no choice)

  3c:set start date checkbox to checked, then due date to unchecked
      alarm checkbox remains checked, enabled
      alarm options remain enabled
      alarm trigger menulist changes to "before start"
      alarm trigger menulist becomes disabled (no choice)
Attachment #161534 - Attachment description: toDoDialog.js patch: control visibility of repeatstart date warning → toDoDialog.js patch: constrain alarm trigger options
Attachment #161534 - Flags: first-review?(mostafah)
Blocks: 257714
Blocks: 220075
Attachment #161534 - Flags: first-review?(mostafah) → first-review+
Patch checked in.Thanks
The crash issue will be fixed in its own bug.
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
The bugspam monkeys have been set free and are feeding on Calendar :: Sunbird Only. Be afraid for your sanity!
QA Contact: gurganbl → sunbird
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: