зеркало из https://github.com/mozilla/gecko-dev.git
Fixing status problems in to do dialogs, bug 168500
This commit is contained in:
Родитель
bb3bc24926
Коммит
213a4594f7
|
@ -152,20 +152,11 @@ function loadCalendarToDoDialog()
|
|||
setFieldValue( "title-field", gToDo.title );
|
||||
setFieldValue( "description-field", gToDo.description );
|
||||
setFieldValue( "uri-field", gToDo.url );
|
||||
|
||||
|
||||
switch( gToDo.status )
|
||||
{
|
||||
case gToDo.ICAL_STATUS_NEEDSACTION:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_NEEDSACTION" );
|
||||
break;
|
||||
case gToDo.ICAL_STATUS_INPROGRESS:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_INPROGRESS" );
|
||||
break;
|
||||
case gToDo.ICAL_STATUS_COMPLETED:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_COMPLETED" );
|
||||
break;
|
||||
case gToDo.ICAL_STATUS_CANCELLED:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_CANCELLED" );
|
||||
setFieldValue( "cancelled-checkbox", true, "checked" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -243,9 +234,7 @@ function onOKCommand()
|
|||
|
||||
gToDo.title = getFieldValue( "title-field" );
|
||||
gToDo.description = getFieldValue( "description-field" );
|
||||
if( getFieldValue( "status-field" ) != "" )
|
||||
gToDo.status = eval( "gToDo."+getFieldValue( "status-field" ) );
|
||||
|
||||
|
||||
var dueDate = getDateTimeFieldValue( "due-date-text" );
|
||||
gToDo.due.year = dueDate.getYear()+1900;
|
||||
gToDo.due.month = dueDate.getMonth();
|
||||
|
@ -275,6 +264,7 @@ function onOKCommand()
|
|||
|
||||
var percentcomplete = getFieldValue( "percent-complete-menulist" );
|
||||
percentcomplete = parseInt( percentcomplete );
|
||||
|
||||
if(percentcomplete > 100)
|
||||
percentcomplete = 100;
|
||||
else if(percentcomplete < 0)
|
||||
|
@ -293,18 +283,23 @@ function onOKCommand()
|
|||
gToDo.status = gToDo.ICAL_STATUS_COMPLETED;
|
||||
}
|
||||
else
|
||||
{
|
||||
gToDo.completed.clear();
|
||||
if (percentcomplete == 0)
|
||||
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
|
||||
else
|
||||
|
||||
var cancelled = getFieldValue( "cancelled-checkbox", "checked" );
|
||||
|
||||
if( cancelled )
|
||||
gToDo.status = gToDo.ICAL_STATUS_CANCELLED;
|
||||
else if (percentcomplete > 0)
|
||||
gToDo.status = gToDo.ICAL_STATUS_INPROCESS;
|
||||
|
||||
|
||||
dump( "!!!-->in calendarEventDialog.js, alarmUnits is "+gToDo.alarmUnits );
|
||||
else
|
||||
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
|
||||
}
|
||||
|
||||
|
||||
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
|
||||
{
|
||||
gToDo.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );
|
||||
dump( "!!!-->in calendarEventDialog.js, alarmEmailAddress is "+gToDo.alarmEmailAddress );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -627,7 +622,10 @@ function getFieldValue( elementId, propertyName )
|
|||
}
|
||||
else
|
||||
{
|
||||
return field.value;
|
||||
if( field )
|
||||
return field.value;
|
||||
else
|
||||
alert( elementId );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -249,16 +249,9 @@
|
|||
<!-- Task Status -->
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="Event Status"/>
|
||||
<label value="&newtodo.status.label;"/>
|
||||
</hbox>
|
||||
<menulist id="status-field" label="&newevent.status.label;">
|
||||
<menupopup id="status-menulist-menupopup">
|
||||
<menuitem label="&newevent.status.needsaction.label;" value="ICAL_STATUS_NEEDSACTION"/>
|
||||
<menuitem label="&newevent.status.inprogress.label;" value="ICAL_STATUS_INPROGRESS"/>
|
||||
<menuitem label="&newevent.status.completed.label;" value="ICAL_STATUS_COMPLETED"/>
|
||||
<menuitem label="&newevent.status.cancelled.label;" value="ICAL_STATUS_CANCELLED"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<checkbox id="cancelled-checkbox" label="&newtodo.cancelled.label;" checked="false"/>
|
||||
</row>
|
||||
|
||||
<!-- Categories -->
|
||||
|
|
|
@ -152,20 +152,11 @@ function loadCalendarToDoDialog()
|
|||
setFieldValue( "title-field", gToDo.title );
|
||||
setFieldValue( "description-field", gToDo.description );
|
||||
setFieldValue( "uri-field", gToDo.url );
|
||||
|
||||
|
||||
switch( gToDo.status )
|
||||
{
|
||||
case gToDo.ICAL_STATUS_NEEDSACTION:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_NEEDSACTION" );
|
||||
break;
|
||||
case gToDo.ICAL_STATUS_INPROGRESS:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_INPROGRESS" );
|
||||
break;
|
||||
case gToDo.ICAL_STATUS_COMPLETED:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_COMPLETED" );
|
||||
break;
|
||||
case gToDo.ICAL_STATUS_CANCELLED:
|
||||
setFieldValue( "status-field", "ICAL_STATUS_CANCELLED" );
|
||||
setFieldValue( "cancelled-checkbox", true, "checked" );
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -243,9 +234,7 @@ function onOKCommand()
|
|||
|
||||
gToDo.title = getFieldValue( "title-field" );
|
||||
gToDo.description = getFieldValue( "description-field" );
|
||||
if( getFieldValue( "status-field" ) != "" )
|
||||
gToDo.status = eval( "gToDo."+getFieldValue( "status-field" ) );
|
||||
|
||||
|
||||
var dueDate = getDateTimeFieldValue( "due-date-text" );
|
||||
gToDo.due.year = dueDate.getYear()+1900;
|
||||
gToDo.due.month = dueDate.getMonth();
|
||||
|
@ -275,6 +264,7 @@ function onOKCommand()
|
|||
|
||||
var percentcomplete = getFieldValue( "percent-complete-menulist" );
|
||||
percentcomplete = parseInt( percentcomplete );
|
||||
|
||||
if(percentcomplete > 100)
|
||||
percentcomplete = 100;
|
||||
else if(percentcomplete < 0)
|
||||
|
@ -293,18 +283,23 @@ function onOKCommand()
|
|||
gToDo.status = gToDo.ICAL_STATUS_COMPLETED;
|
||||
}
|
||||
else
|
||||
{
|
||||
gToDo.completed.clear();
|
||||
if (percentcomplete == 0)
|
||||
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
|
||||
else
|
||||
|
||||
var cancelled = getFieldValue( "cancelled-checkbox", "checked" );
|
||||
|
||||
if( cancelled )
|
||||
gToDo.status = gToDo.ICAL_STATUS_CANCELLED;
|
||||
else if (percentcomplete > 0)
|
||||
gToDo.status = gToDo.ICAL_STATUS_INPROCESS;
|
||||
|
||||
|
||||
dump( "!!!-->in calendarEventDialog.js, alarmUnits is "+gToDo.alarmUnits );
|
||||
else
|
||||
gToDo.status = gToDo.ICAL_STATUS_NEEDSACTION;
|
||||
}
|
||||
|
||||
|
||||
if ( getFieldValue( "alarm-email-checkbox", "checked" ) )
|
||||
{
|
||||
gToDo.alarmEmailAddress = getFieldValue( "alarm-email-field", "value" );
|
||||
dump( "!!!-->in calendarEventDialog.js, alarmEmailAddress is "+gToDo.alarmEmailAddress );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -627,7 +622,10 @@ function getFieldValue( elementId, propertyName )
|
|||
}
|
||||
else
|
||||
{
|
||||
return field.value;
|
||||
if( field )
|
||||
return field.value;
|
||||
else
|
||||
alert( elementId );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -249,16 +249,9 @@
|
|||
<!-- Task Status -->
|
||||
<row align="center">
|
||||
<hbox class="field-label-box-class" pack="end">
|
||||
<label value="Event Status"/>
|
||||
<label value="&newtodo.status.label;"/>
|
||||
</hbox>
|
||||
<menulist id="status-field" label="&newevent.status.label;">
|
||||
<menupopup id="status-menulist-menupopup">
|
||||
<menuitem label="&newevent.status.needsaction.label;" value="ICAL_STATUS_NEEDSACTION"/>
|
||||
<menuitem label="&newevent.status.inprogress.label;" value="ICAL_STATUS_INPROGRESS"/>
|
||||
<menuitem label="&newevent.status.completed.label;" value="ICAL_STATUS_COMPLETED"/>
|
||||
<menuitem label="&newevent.status.cancelled.label;" value="ICAL_STATUS_CANCELLED"/>
|
||||
</menupopup>
|
||||
</menulist>
|
||||
<checkbox id="cancelled-checkbox" label="&newtodo.cancelled.label;" checked="false"/>
|
||||
</row>
|
||||
|
||||
<!-- Categories -->
|
||||
|
|
|
@ -111,6 +111,8 @@
|
|||
<!ENTITY newtodo.percentcomplete.label "% complete">
|
||||
<!ENTITY newtodo.categories.label "Categories">
|
||||
<!ENTITY newtodo.starttime.warning "Your start date occurs after your due date.">
|
||||
<!ENTITY newtodo.cancelled.label "Cancelled">
|
||||
<!ENTITY newtodo.status.label "Status">
|
||||
|
||||
<!ENTITY calendar.confirm.deleteevent "Are you sure you want to delete this event titled: " >
|
||||
<!ENTITY calendar.confirm.deleteuntitledevent "Are you sure you want to delete this untitled event?" >
|
||||
|
|
Загрузка…
Ссылка в новой задаче