iMIP bar should ask user what calendar to add invitation to



13 years ago
10 years ago


(Reporter: cmtalbert, Assigned: sebo.moz)


Bug Flags:
blocking-calendar0.7 +



(1 attachment, 1 obsolete attachment)



13 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20060728 Firefox/
Build Identifier: Lightning BuildID 2006082320 Thunderbird version 3 alpha 1 20060811

The iMIP bar should ask the user what calendar that he or she wants to add the invite to. 
Currently, it only adds invitations to the first calendar in the calendar list.

Reproducible: Always

Steps to Reproduce:
1. Receive an iMIP invitation through email (running tbird and lightning)
2. Click on email
3. Use iMIP Bar and choose to "Add invitation to calendar"

Actual Results:  
Invitation is added to first calendar in list.

Expected Results:  
A calendar picker would appear and ask you what calendar you want to add the invitation to. Additionally, that calendar picker might also have a checkbox to "use this calendar as default for all invitations", and then the iMIP bar could just add to that one automatically next time.
Duplicate of this bug: 368072

Comment 2

12 years ago
Setting severity to major as we also aren't able to sort calendars in the list (bug 266249).
Severity: normal → major

Comment 3

12 years ago
Posted patch Calls the Calendar Picker (obsolete) — Splinter Review
Calls the calendar picker that is also used on import/export. I couldn't get persistent to work, so that the selected calendar is remembered. Any hints welcome.
Attachment #265459 - Flags: review?(ctalbert)
Assignee: nobody → sebo.moz

Comment 4

12 years ago
Comment on attachment 265459 [details] [diff] [review]
Calls the Calendar Picker

>Index: calendar/lightning/content/imip-bar.js
>RCS file: /cvsroot/mozilla/calendar/lightning/content/imip-bar.js,v
>retrieving revision
>diff -u -8 -p -r1.1.2.5 imip-bar.js
>--- calendar/lightning/content/imip-bar.js	12 Apr 2007 19:31:33 -0000
>+++ calendar/lightning/content/imip-bar.js	20 May 2007 21:40:09 -0000
>@@ -75,17 +75,16 @@ function checkForItipItem(subject)
>     }
>     // We are only called upon receipt of an invite, so ensure that isSend
>     // is false.
>     itipItem.isSend = false;
>     // XXX Get these from preferences
>     itipItem.autoResponse = Components.interfaces.calIItipItem.USER;
>-    itipItem.targetCalendar = getTargetCalendar();
>     var imipMethod = getMsgImipMethod();
>     if (imipMethod &&
>         imipMethod.length != 0 &&
>         imipMethod.toLowerCase() != "nomethod")
>     {
>         itipItem.receivedMethod = imipMethod;
>     } else {
>@@ -255,24 +254,40 @@ function getMsgRecipient()
>                 imipRecipient = recipient;
>             }
>         }
>     }
>     return imipRecipient;
> }
> /**
>- * Bug 351745 - Call calendar picker here
>+ * Call the calendar picker
>  */
> function getTargetCalendar()
> {
>+    var calendarToReturn;
>     var calMgr = Components.classes[";1"]
>                            .getService(Components.interfaces.calICalendarManager);
>-    var cals = calMgr.getCalendars({});
>-    return cals[0];
>+    var count = new Object();
>+    calMgr.getCalendars(count);
You need to capture the return here: var calArray = calMgr.getCalendars(count)

>+    if (count.value == 1) {
>+        // There's only one calendar, so it's silly to ask what calendar
>+        // the user wants to import into.
>+        calendarToReturn = calMgr.getCalendars(count[0]);
Good idea, but getCalendars always returns a full list of all registered calendars, so instead you need to use the calArray from above and do this: calendarToReturn = calArray[0];  instead of the line you have here.

>+    } else {
>+        // Ask what calendar to import into
>+        var args = new Object();
>+        var aCal;
>+        args.onOk = function selectCalendar(aCal) { calendarToReturn = aCal; };
>+        args.promptText = calGetString("calendar", "importPrompt");
>+        openDialog("chrome://calendar/content/chooseCalendarDialog.xul", 
Extra space at the end of this ^^ line, please remove it.

Thanks for the patch, it was sorely needed.  I've tested the patch with the change as described above and it works for me on Mac.  r=ctalbert with those changes.  If you decide to change more than that, please ask for re-review, otherwise you can carry the review forward.
Attachment #265459 - Flags: review?(ctalbert) → review+
This code will suffer the same problem as in bug 346540.
Depends on: 346540
(In reply to comment #5)
> This code will suffer the same problem as in bug 346540.

Bug 346540 is not present in Lightning because in Lightning it's not possible to remove all calendars.

Comment 7

12 years ago
Thats the new patch; corrections by ctalbert included. I carried forward the +r by ctalbert. 

Does this fix the bug or do we want to address the idea of having a default calendar and/or an "always use this calendar"-checkbox?
Attachment #265459 - Attachment is obsolete: true
Attachment #271298 - Flags: review+


12 years ago
Whiteboard: [checkin needed]
Keywords: checkin-needed
Whiteboard: [checkin needed]

Comment 8

12 years ago
(In reply to comment #7)
> Does this fix the bug or do we want to address the idea of having a default
> calendar and/or an "always use this calendar"-checkbox?
I believe this fixes the bug.   If we want to use a preference based system to remember a default calendar that can be addressed in a separate bug.  The preference based calendar idea for iTIP only starts making sense when you start doing FREEBUSY via iTIP and no one does that yet.

Thanks for the patch Sebo!
Flags: blocking-calendar0.7+
Target Milestone: --- → 0.7
checkin-needed for attachment 271298 [details] [diff] [review] (TRUNK and MOZILLA_1_8_BRANCH)
Checked in on HEAD and MOZILLA_1_8_BRANCH

Last Resolved: 12 years ago
Resolution: --- → FIXED

Comment 11

12 years ago
Verified with lightning build 2007071904, task is fixed.


12 years ago
Duplicate of this bug: 394175
Duplicate of this bug: 397402
Component: Internal Components → E-mail based Scheduling (iTIP/iMIP)
QA Contact: base → email-scheduling
I think this should be reopened. This has regressed in:

Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20090715 Lightning/1.0pre Thunderbird/3.0b3

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/20090715 Lightning/1.0pre Thunderbird/3.0b3

I'm no longer asked which calendar the accepted event should be added to.
Jason, please open a new bug as this one is rather old (comment#0)! Please describe the steps to reproduce the issue in detail there.
The STR is exactly the same as comment #0, unfortunately! Filed Bug 504903
You need to log in before you can comment on or make changes to this bug.