Here's the patch to hide all fields not needed during task and event editing.
Michael
diff --exclude debian -ru webcit/calendar.c webcit-7.42-dfsg/calendar.c
--- webcit/calendar.c 2009-03-08 17:47:29.000000000 +0100
+++ webcit-7.42-dfsg/calendar.c 2009-03-08 20:03:00.000000000 +0100
@@ -675,6 +675,7 @@
wprintf(_("No date"));
wprintf(" ");
+ wprintf("<span ID=\"dtstart_date\">");
wprintf(_("or"));
wprintf(" ");
if (p != NULL) {
@@ -684,13 +685,13 @@
IcalTime = icaltime_current_time_with_zone(get_default_icaltimezone());
display_icaltimetype_as_webform(&IcalTime, "dtstart", 0);
- wprintf("<INPUT TYPE=\"CHECKBOX\" NAME=\"dtstart_time\" ID=\"dtstart_time\" VALUE=\"yes\"");
+ wprintf("<INPUT TYPE=\"CHECKBOX\" NAME=\"dtstart_time_assoc\" ID=\"dtstart_time_assoc\" VALUE=\"yes\"");
if (!IcalTime.is_date) {
wprintf("CHECKED=\"CHECKED\"");
}
wprintf(">");
wprintf(_("Time associated"));
- wprintf("</TD></TR>\n");
+ wprintf("</span></TD></TR>\n");
wprintf("<TR><TD>");
wprintf(_("Due date:"));
@@ -703,6 +704,7 @@
wprintf(">");
wprintf(_("No date"));
wprintf(" ");
+ wprintf("<span ID=\"due_date\">\n");
wprintf(_("or"));
wprintf(" ");
if (p != NULL) {
@@ -712,13 +714,13 @@
IcalTime = icaltime_current_time_with_zone(get_default_icaltimezone());
display_icaltimetype_as_webform(&IcalTime, "due", 0);
- wprintf("<INPUT TYPE=\"CHECKBOX\" NAME=\"due_time\" ID=\"due_time\" VALUE=\"yes\"");
+ wprintf("<INPUT TYPE=\"CHECKBOX\" NAME=\"due_time_assoc\" ID=\"due_time_assoc\" VALUE=\"yes\"");
if (!IcalTime.is_date) {
wprintf("CHECKED=\"CHECKED\"");
}
wprintf(">");
wprintf(_("Time associated"));
- wprintf("</TD></TR>\n");
+ wprintf("</span></TD></TR>\n");
todoStatus = icalcomponent_get_status(vtodo);
wprintf("<TR><TD>\n");
wprintf(_("Completed:"));
diff --exclude debian -ru webcit/calendar_tools.c webcit-7.42-dfsg/calendar_tools.c
--- webcit/calendar_tools.c 2009-03-08 17:47:29.000000000 +0100
+++ webcit-7.42-dfsg/calendar_tools.c 2009-03-09 10:27:02.000000000 +0100
@@ -65,6 +65,7 @@
wprintf("\" id=\"");
wprintf(prefix);
wprintf("\" size=\"10\" maxlength=\"10\" value=\"");
+
wc_strftime(timebuf, 32, "%Y-%m-%d", &tm);
wprintf(timebuf);
wprintf("\">");
@@ -80,8 +81,11 @@
wprintf("<div style=\"display:none\">");
}
+ wprintf("<span ID=\"");
+ wprintf(prefix);
+ wprintf("_time\">");
wprintf(_("Hour: "));
- wprintf("<SELECT NAME=\"%s_hour\" ID=\"%s_hour\" SIZE=\"1\">\n", prefix, prefix);
+ wprintf("<SELECT SIZE=\"1\">\n");
for (i=0; i<=23; ++i) {
if (time_format == WC_TIMEFORMAT_24) {
@@ -101,7 +105,7 @@
wprintf("</SELECT>\n");
wprintf(_("Minute: "));
- wprintf("<SELECT NAME=\"%s_minute\" ID=\"%s_minute\" SIZE=\"1\">\n", prefix, prefix);
+ wprintf("<SELECT SIZE=\"1\">\n");
for (i=0; i<=59; ++i) {
if ( (i % 5 == 0) || (tm.tm_min == i) ) {
wprintf("<OPTION %s VALUE=\"%d\">:%02d</OPTION>\n",
@@ -110,7 +114,7 @@
);
}
}
- wprintf("</SELECT>\n");
+ wprintf("</SELECT></span>\n");
if (date_only) {
wprintf("</div>");
diff --exclude debian -ru webcit/static/wclib.js webcit-7.42-dfsg/static/wclib.js
--- webcit/static/wclib.js 2009-03-08 17:47:26.000000000 +0100
+++ webcit-7.42-dfsg/static/wclib.js 2009-03-09 10:52:15.000000000 +0100
@@ -649,52 +649,42 @@
// TODO: Collapse into one function
function toggleTaskDtStart(event) {
var checkBox = $('nodtstart');
- var checkBoxTime = $('dtstart_time');
- dtStart = document.getElementById("dtstart");
- dtStartHour = document.getElementById("dtstart_hour");
- dtStartMinute = document.getElementById("dtstart_minute");
+ var checkBoxTime = $('dtstart_time_assoc');
+ var dtstart = document.getElementById("dtstart");
+ var dtstart_date = document.getElementById("dtstart_date");
+ var dtstart_time = document.getElementById("dtstart_time");
if (checkBox.checked) {
- dtStart.disabled = true;
- dtStartHour.disabled = true;
- dtStartMinute.disabled = true;
- dtStart.style.textDecoration = "line-through";
+ dtstart_date.style.visibility = "hidden";
+ dtstart_time.style.visibility = "hidden";
} else {
- dtStart.disabled = false;
if (checkBoxTime.checked) {
- dtStartHour.disabled = false;
- dtStartMinute.disabled = false;
+ dtstart_time.style.visibility = "visible";
} else {
- dtStartHour.disabled = true;
- dtStartMinute.disabled = true;
+ dtstart_time.style.visibility = "hidden";
}
- dtStart.style.textDecoration = "";
- if (dtStart.value.length == 0)
- dtStart.dpck._initCurrentDate();
+ dtstart_date.style.visibility = "visible";
+ if (dtstart.value.length == 0)
+ dtstart.dpck._initCurrentDate();
}
}
function toggleTaskDue(event) {
var checkBox = $('nodue');
- var checkBoxTime = $('due_time');
- dueField = document.getElementById("due");
- dueFieldHour = document.getElementById("due_hour");
- dueFieldMinute = document.getElementById("due_minute");
+ var checkBoxTime = $('due_time_assoc');
+ var due = document.getElementById("due");
+ var due_date = document.getElementById("due_date");
+ var due_time = document.getElementById("due_time");
if (checkBox.checked) {
- dueField.disabled = true;
- dueFieldHour.disabled = true;
- dueFieldMinute.disabled = true;
- dueField.style.textDecoration = "line-through";
+ due_date.style.visibility = "hidden";
+ due_time.style.visibility = "hidden";
} else {
- dueField.disabled = false;
if (checkBoxTime.checked) {
- dueFieldHour.disabled = false;
- dueFieldMinute.disabled = false;
+ due_time.style.visibility = "visible";
} else {
- dueFieldHour.disabled = true;
- dueFieldMinute.disabled = true;
+ due_time.style.visibility = "hidden";
}
- dueField.style.textDecoration = "";
- if (dueField.value.length == 0)
- dueField.dpck._initCurrentDate();
+ due_date.style.visibility = "visible";
+ if (due.value.length == 0)
+ due.dpck._initCurrentDate();
}
}
function ToggleTaskDateOrNoDateActivate(event) {
@@ -703,9 +693,9 @@
toggleTaskDtStart(null);
toggleTaskDue(null);
$('nodtstart').observe('click', toggleTaskDtStart);
- $('dtstart_time').observe('click', toggleTaskDtStart);
+ $('dtstart_time_assoc').observe('click', toggleTaskDtStart);
$('nodue').observe('click', toggleTaskDue);
- $('due_time').observe('click', toggleTaskDue);
+ $('due_time_assoc').observe('click', toggleTaskDue);
}
}
function TaskViewGatherCategoriesFromTable() {
@@ -724,13 +714,14 @@
}
function eventEditAllDay() {
var allDayCheck = document.getElementById("alldayevent");
- var dtend= document.getElementById("dtendcell");
+ var dtend = document.getElementById("dtendcell");
+ var dtstart_time = document.getElementById("dtstart_time");
if(allDayCheck.checked) {
- //dtend.disabled = true;
- dtend.style.textDecoration = "line-through";
+ dtstart_time.style.visibility = "hidden";
+ dtend.style.visibility = "hidden";
} else {
- //dtend_day.disabled = false;
- dtend.style.textDecoration = "";
+ dtstart_time.style.visibility = "visible";
+ dtend.style.visibility = "visible";
}
}