rem: setItemProperty(item, "PERCENT-COMPLETE", getElementValue("percent-complete-menulist"));  
context: function saveDialog(item){    setItemProperty(item, "title",       getElementValue("item-title"));    setItemProperty(item, "LOCATION",    getElementValue("item-location"));    var kDefaultTimezone = calendarDefaultTimezone();    if (isEvent(item)) {        var startDate = jsDateToDateTime(getElementValue("event-starttime"));        var endDate = jsDateToDateTime(getElementValue("event-endtime"));        startDate = startDate.getInTimezone(kDefaultTimezone);        endDate = endDate.getInTimezone(kDefaultTimezone);        var isAllDay = getElementValue("event-all-day", "checked");        if (isAllDay) {            startDate.isDate = true;            startDate.normalize();            endDate.isDate = true;            endDate.day += 1;            endDate.normalize();        }        setItemProperty(item, "startDate",   startDate);        setItemProperty(item, "endDate",     endDate);    }    if (isToDo(item)) {        var entryDate = getElementValue("todo-has-entrydate", "checked") ?             jsDateToDateTime(getElementValue("todo-entrydate")) : null;        if (entryDate) {            entryDate = entryDate.getInTimezone(kDefaultTimezone);        }        setItemProperty(item, "entryDate",   entryDate);        var dueDate = getElementValue("todo-has-duedate", "checked") ?             jsDateToDateTime(getElementValue("todo-duedate")) : null;        if (dueDate) {            dueDate = dueDate.getInTimezone(kDefaultTimezone);        }        setItemProperty(item, "dueDate",     dueDate);    }    /* recurrence */    if (getElementValue("item-recurrence", "checked")) {        if (window.recurrenceInfo) {            item.recurrenceInfo = window.recurrenceInfo;        }    } else {        item.recurrenceInfo = null;    }    /* Category */    var category = getElementValue("item-categories");    if (category != "NONE") {       setItemProperty(item, "CATEGORIES", category);    } else {       item.deleteProperty("CATEGORIES");    }    if (!gDetailsShown) {        // We never showed the items in the 'More' box.  That means that clone()        // took care of it, so just return now        dump(item.icalString + '\n');        return;    }    setItemProperty(item, "URL",         getElementValue("item-url"));    setItemProperty(item, "DESCRIPTION", getElementValue("item-description"));    var status;    if (isEvent(item)) {        status = getElementValue("event-status");    } else {        status = getElementValue("todo-status");    }    setItemProperty(item, "STATUS",   status);    setItemProperty(item, "PRIORITY", getElementValue("priority-levels"));    setItemProperty(item, "CLASS", getElementValue("privacy-menulist"));    if (item.status == "COMPLETED" && isToDo(item)) {        item.completedDate = jsDateToDateTime(getElementValue("completed-date-picker"));    }    setItemProperty(item, "PERCENT-COMPLETE", getElementValue("percent-complete-menulist"));    /* attendence */    item.removeAllAttendees();    var attendeeListBox = document.getElementById("attendees-listbox");    for each (kid in attendeeListBox.childNodes) {        if (kid.attendee) {            item.addAttendee(kid.attendee);        }    }    /* alarms */    var hasAlarm = (getElementValue("item-alarm") != "none");    if (!hasAlarm) {        item.alarmOffset = null;        item.alarmLastAck = null;        item.alarmRelated = null;    } else {        var alarmLength = getElementValue("alarm-length-field");        var alarmUnits = document.getElementById("alarm-length-units").selectedItem.value;        if (document.getElementById("alarm-trigger-relation").selectedItem.value == "START") {            item.alarmRelated = item.ALARM_RELATED_START;        } else {            item.alarmRelated = item.ALARM_RELATED_END;        }        var duration = Components.classes["@mozilla.org/calendar/duration;1"]                                 .createInstance(Components.interfaces.calIDuration);        if (item.alarmRelated == item.ALARM_RELATED_START) {            duration.isNegative = true;        }        duration[alarmUnits] = alarmLength;        duration.normalize();        item.alarmOffset = duration;    }    dump(item.icalString + "\n");}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/ad76492def133383e381a02afa958963529a4660/calendar-event-dialog.js/buggy/calendar/base/content/calendar-event-dialog.js