Monotone-Parent: 25201eca7a2d2327ce725455760027b032810d78
Monotone-Revision: beff03702ba361b408bf967b4f807a2fec161392 Monotone-Author: wsourdeau@inverse.ca Monotone-Date: 2006-10-19T14:40:24 Monotone-Branch: ca.inverse.sogomaint-2.0.2
parent
b790b4778e
commit
dcfb1be7f3
|
@ -33,6 +33,8 @@
|
|||
@interface UIxTaskEditor : UIxComponentEditor
|
||||
{
|
||||
NSCalendarDate *dueDate;
|
||||
BOOL hasStartDate;
|
||||
BOOL hasDueDate;
|
||||
}
|
||||
|
||||
- (void) setTaskStartDate: (NSCalendarDate *) _date;
|
||||
|
|
|
@ -77,8 +77,6 @@
|
|||
@"STATUS:NEEDS-ACTION\r\n" /* confirmed by default */
|
||||
@"PERCENT-COMPLETE:0\r\n"
|
||||
@"DTSTAMP:%@Z\r\n"
|
||||
@"DTSTART:%@\r\n"
|
||||
@"DUE:%@\r\n"
|
||||
@"SEQUENCE:1\r\n"
|
||||
@"PRIORITY:5\r\n"
|
||||
@"%@" /* organizer */
|
||||
|
@ -86,7 +84,7 @@
|
|||
@"END:VTODO\r\n"
|
||||
@"END:VCALENDAR";
|
||||
|
||||
NSCalendarDate *lStartDate, *lDueDate, *stamp;
|
||||
NSCalendarDate *stamp;
|
||||
NSString *template, *s;
|
||||
unsigned minutes;
|
||||
|
||||
|
@ -97,10 +95,6 @@
|
|||
else {
|
||||
minutes = 60;
|
||||
}
|
||||
lStartDate = [self selectedDate];
|
||||
lDueDate = [lStartDate dateByAddingYears:0 months:0 days:0
|
||||
hours:0 minutes:minutes seconds:0];
|
||||
|
||||
stamp = [NSCalendarDate calendarDate];
|
||||
[stamp setTimeZone: [NSTimeZone timeZoneWithName: @"GMT"]];
|
||||
|
||||
|
@ -108,8 +102,6 @@
|
|||
template = [NSString stringWithFormat:iCalStringTemplate,
|
||||
[[self clientObject] nameInContainer],
|
||||
[stamp iCalFormattedDateTimeString],
|
||||
[lStartDate iCalFormattedDateTimeString],
|
||||
[lDueDate iCalFormattedDateTimeString],
|
||||
[self iCalOrganizerString],
|
||||
s];
|
||||
return template;
|
||||
|
@ -182,22 +174,33 @@
|
|||
|
||||
uTZ = [[self clientObject] userTimeZone];
|
||||
dueDate = [_task due];
|
||||
if (!dueDate)
|
||||
dueDate = [[self startDate] dateByAddingYears: 0 months: 0 days: 0
|
||||
hours: 1 minutes: 0 seconds: 0];
|
||||
|
||||
// if (!dueDate)
|
||||
// dueDate = [[self startDate] dateByAddingYears: 0 months: 0 days: 0
|
||||
// hours: 1 minutes: 0 seconds: 0];
|
||||
if (dueDate)
|
||||
{
|
||||
[dueDate setTimeZone: uTZ];
|
||||
[dueDate retain];
|
||||
}
|
||||
}
|
||||
|
||||
- (void) saveValuesIntoTask: (iCalToDo *) _task
|
||||
{
|
||||
/* merge in form values */
|
||||
NSArray *attendees, *lResources;
|
||||
iCalRecurrenceRule *rrule;
|
||||
NSCalendarDate *dateTime;
|
||||
|
||||
[_task setStartDate: [self taskStartDate]];
|
||||
[_task setDue: [self taskDueDate]];
|
||||
if (hasStartDate)
|
||||
dateTime = [self taskStartDate];
|
||||
else
|
||||
dateTime = nil;
|
||||
[_task setStartDate: dateTime];
|
||||
if (hasDueDate)
|
||||
dateTime = [self taskDueDate];
|
||||
else
|
||||
dateTime = nil;
|
||||
[_task setDue: dateTime];
|
||||
|
||||
[_task setSummary: [self title]];
|
||||
[_task setLocation: [self location]];
|
||||
|
@ -444,4 +447,42 @@
|
|||
return [self redirectToLocation: [self completeURIForMethod:@"../view"]];
|
||||
}
|
||||
|
||||
- (void) setHasStartDate: (BOOL) aBool
|
||||
{
|
||||
hasStartDate = aBool;
|
||||
}
|
||||
|
||||
- (BOOL) hasStartDate
|
||||
{
|
||||
return ([self taskStartDate] != nil);
|
||||
}
|
||||
|
||||
- (BOOL) startDateDisabled
|
||||
{
|
||||
return ![self hasStartDate];
|
||||
}
|
||||
|
||||
- (void) setHasDueDate: (BOOL) aBool
|
||||
{
|
||||
hasDueDate = aBool;
|
||||
}
|
||||
|
||||
- (BOOL) hasDueDate
|
||||
{
|
||||
return ([self taskDueDate] != nil);
|
||||
}
|
||||
|
||||
- (BOOL) dueDateDisabled
|
||||
{
|
||||
return ![self hasDueDate];
|
||||
}
|
||||
|
||||
- (void) setDueDateDisabled: (BOOL) aBool
|
||||
{
|
||||
}
|
||||
|
||||
- (void) setStartDateDisabled: (BOOL) aBool
|
||||
{
|
||||
}
|
||||
|
||||
@end /* UIxTaskEditor */
|
||||
|
|
|
@ -35,17 +35,26 @@
|
|||
var:checked="isPrivate"
|
||||
/><var:string label:value="is private" /></label>
|
||||
<span class="checkBoxList"><var:string label:value="Date" />
|
||||
<span class="content"><var:component className="UIxTimeDateControl"
|
||||
<span class="content"
|
||||
><input var:checked="hasStartDate" type="checkbox" class="checkBox"
|
||||
onchange="onTimeControlCheck(this);"
|
||||
/><var:component className="UIxTimeDateControl"
|
||||
var:disabled="startDateDisabled"
|
||||
const:controlID="startTime"
|
||||
date="taskStartDate"
|
||||
const:dayStartHour="0"
|
||||
const:dayEndHour="23"
|
||||
/></span></span>
|
||||
<a class="button" href="#" onclick="return toggleDetails();" id="detailsButton"
|
||||
<a class="button" href="#" onclick="return toggleDetails();"
|
||||
id="detailsButton"
|
||||
><var:string label:value="Show Details" /></a>
|
||||
<span class="checkBoxList"><var:string label:value="Due Time" />
|
||||
<span class="content"><var:component className="UIxTimeDateControl"
|
||||
const:controlID="endTime"
|
||||
<span class="content"
|
||||
><input var:checked="hasDueDate" type="checkbox" class="checkBox"
|
||||
onchange="onTimeControlCheck(this);"
|
||||
/><var:component className="UIxTimeDateControl"
|
||||
var:disabled="dueDateDisabled"
|
||||
const:controlID="dueTime"
|
||||
date="taskDueDate"
|
||||
const:dayStartHour="0"
|
||||
const:dayEndHour="23"
|
||||
|
@ -83,7 +92,8 @@
|
|||
></span
|
||||
></label>
|
||||
|
||||
<span class="checkBoxList" id="participantsCB"><var:string label:value="Participants" />
|
||||
<span class="checkBoxList" id="participantsCB"
|
||||
><var:string label:value="Participants" />
|
||||
<span class="content"><var:component className="UIxContactSelector"
|
||||
const:selectorId="participants"
|
||||
contacts="participants"
|
||||
|
@ -101,6 +111,11 @@
|
|||
<var:popup list="priorities" item="item"
|
||||
string="itemPriorityText" selection="priority" /></label>
|
||||
|
||||
<label style="clear: both;"><var:string label:value="Calendar" />
|
||||
<var:popup list="availableCalendars" item="item"
|
||||
const:onChange="onChangeCalendar(this);"
|
||||
string="item" selection="componentOwner" /></label>
|
||||
|
||||
<label><var:string label:value="Comment"
|
||||
/><textarea name="comment" var:value="comment" /></label>
|
||||
</div>
|
||||
|
|
|
@ -48,6 +48,7 @@ function validateAptEditor() {
|
|||
}
|
||||
|
||||
e = document.getElementById('startTime_date');
|
||||
if (!e.disabled) {
|
||||
if (e.value.length != 10) {
|
||||
alert(labels.validate_invalid_startdate.decodeEntities());
|
||||
return false;
|
||||
|
@ -57,8 +58,10 @@ function validateAptEditor() {
|
|||
alert(labels.validate_invalid_startdate.decodeEntities());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
e = document.getElementById('endTime_date');
|
||||
e = document.getElementById('dueTime_date');
|
||||
if (!e.disabled) {
|
||||
if (e.value.length != 10) {
|
||||
alert(labels.validate_invalid_enddate.decodeEntities());
|
||||
return false;
|
||||
|
@ -68,6 +71,7 @@ function validateAptEditor() {
|
|||
alert(labels.validate_invalid_enddate.decodeEntities());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// cuicui = '';
|
||||
tmpdate = uixEarlierDate(startdate, enddate);
|
||||
if (tmpdate == enddate) {
|
||||
|
@ -80,7 +84,7 @@ function validateAptEditor() {
|
|||
var start, end;
|
||||
|
||||
start = parseInt(document.forms[0]['startTime_time_hour'].value);
|
||||
end = parseInt(document.forms[0]['endTime_time_hour'].value);
|
||||
end = parseInt(document.forms[0]['dueTime_time_hour'].value);
|
||||
|
||||
if (start > end) {
|
||||
alert(labels.validate_endbeforestart.decodeEntities());
|
||||
|
@ -88,7 +92,7 @@ function validateAptEditor() {
|
|||
}
|
||||
else if (start == end) {
|
||||
start = parseInt(document.forms[0]['startTime_time_minute'].value);
|
||||
end = parseInt(document.forms[0]['endTime_time_minute'].value);
|
||||
end = parseInt(document.forms[0]['dueTime_time_minute'].value);
|
||||
if (start > end) {
|
||||
alert(labels.validate_endbeforestart.decodeEntities());
|
||||
return false;
|
||||
|
@ -167,3 +171,14 @@ function addContact(tag, fullContactName, contactId, contactName, contactEmail)
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
function onTimeControlCheck(checkBox) {
|
||||
var inputs = checkBox.parentNode.getElementsByTagName("input");
|
||||
var selects = checkBox.parentNode.getElementsByTagName("select");
|
||||
for (var i = 0; i < inputs.length; i++)
|
||||
if (inputs[i] != checkBox)
|
||||
inputs[i].disabled = !checkBox.checked;
|
||||
for (var i = 0; i < selects.length; i++)
|
||||
if (selects[i] != checkBox)
|
||||
selects[i].disabled = !checkBox.checked;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue