bug #367110 Missing Thunderbird integration for copy/paste r1=lilmatt,r2=mvl

This commit is contained in:
michael.buettner%sun.com 2007-02-14 16:04:32 +00:00
parent 6baf1596b7
commit bac4e07c9a

View File

@ -774,3 +774,34 @@ function calGetEndDate(aItem)
return (isEvent(aItem) ? aItem.endDate : aItem.dueDate);
}
/**
* Delete the current selected items with focus from the unifinder list
*/
function deleteEventCommand(doNotConfirm)
{
var selectedItems = currentView().getSelectedItems({});
deleteItems(selectedItems,doNotConfirm);
}
/**
* This is called from the unifinder's delete command
*/
function deleteItems(selectedItems, doNotConfirm)
{
if (!selectedItems) {
return;
}
startBatchTransaction();
for (var i in selectedItems) {
var aOccurrence = selectedItems[i];
if (aOccurrence.parentItem != aOccurrence) {
var event = aOccurrence.parentItem.clone();
event.recurrenceInfo.removeOccurrenceAt(aOccurrence.recurrenceId);
doTransaction('modify', event, event.calendar, aOccurrence.parentItem, null);
} else {
doTransaction('delete', aOccurrence, aOccurrence.calendar, null, null);
}
}
endBatchTransaction();
}