$Log$
+Revision 504.1 2004/02/03 03:09:51 ajc
+* THIS IS 5.04
+
Revision 503.0 2004/01/28 04:31:31 ajc
* THIS IS 5.03
1998-12-03 Nathan Bryant <bryant@cs.usm.maine.edu>
* webserver.c: warning fix
+
* Process a calendar object
* ...at this point it's already been deserialized by cal_process_attachment()
*
- * ok for complete vcalendar objects
- *
*/
void cal_process_object(icalcomponent *cal,
int recursion_level,
/*
* Deserialize a calendar object in a message so it can be processed.
* (This is the main entry point for these things)
- * ok for complete vcalendar objects
*/
void cal_process_attachment(char *part_source, long msgnum, char *cal_partnum) {
icalcomponent *cal;
/*
* Display a task by itself (for editing)
*
- * ok for complete vcalendar objects
*/
void display_edit_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
icalcomponent *vtodo;
/*
* Save an edited task
*
- * ok
*/
void save_individual_task(icalcomponent *supplied_vtodo, long msgnum) {
char buf[SIZ];
* the relevant part, deserialize it into a libical component, filter it for
* the requested object type, and feed it to the specified handler.
*
- * ok
*/
void display_using_handler(long msgnum,
char *mimetype,
void display_icaltimetype_as_webform(struct icaltimetype *t, char *prefix) {
int i;
-
time_t now;
struct tm tm_now;
int this_year;
-
time_t tt;
struct tm tm;
-
const int span = 10;
+ int all_day_event = 0;
now = time(NULL);
memcpy(&tm_now, localtime(&now), sizeof(struct tm));
this_year = tm_now.tm_year + 1900;
if (t == NULL) return;
+ if (t->is_date) all_day_event = 1;
tt = icaltime_as_timet(*t);
- memcpy(&tm, localtime(&tt), sizeof(struct tm));
+ if (all_day_event) {
+ memcpy(&tm, gmtime(&tt), sizeof(struct tm));
+ }
+ else {
+ memcpy(&tm, localtime(&tt), sizeof(struct tm));
+ }
wprintf("Month: ");
wprintf("<SELECT NAME=\"%s_month\" SIZE=\"1\">\n", prefix);
if (p != NULL) {
t = icalproperty_get_dtstart(p);
event_tt = icaltime_as_timet(t);
- memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+
+ if (t.is_date) all_day_event = 1;
+ else all_day_event = 0;
+
+ if (all_day_event) {
+ memcpy(&event_tm, gmtime(&event_tt), sizeof(struct tm));
+ }
+ else {
+ memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+ }
+
+lprintf(9, "Event: %04d/%02d/%02d, Now: %04d/%02d/%02d\n",
+ event_tm.tm_year,
+ event_tm.tm_mon,
+ event_tm.tm_mday,
+ today_tm.tm_year,
+ today_tm.tm_mon,
+ today_tm.tm_mday);
+
+
if ((event_tm.tm_year == today_tm.tm_year)
&& (event_tm.tm_mon == today_tm.tm_mon)
&& (event_tm.tm_mday == today_tm.tm_mday)) {
- if (t.is_date) all_day_event = 1;
- else all_day_event = 0;
-
p = icalcomponent_get_first_property(
WC->disp_cal[i],
ICAL_SUMMARY_PROPERTY);
if (p != NULL) {
t = icalproperty_get_dtstart(p);
event_tt = icaltime_as_timet(t);
- event_tm = localtime(&event_tt);
+ if (t.is_date) all_day_event = 1;
+
+ if (all_day_event) {
+ event_tm = gmtime(&event_tt);
+ }
+ else {
+ event_tm = localtime(&event_tt);
+ }
+
if ((event_tm->tm_year == (year-1900))
&& (event_tm->tm_mon == (month-1))
&& (event_tm->tm_mday == day)
&& ( ((event_tm->tm_hour == hour)&&(!t.is_date)) || ((hour<0)&&(t.is_date)) )
) {
- if (t.is_date) all_day_event = 1;
p = icalcomponent_get_first_property(
WC->disp_cal[i],
if (p != NULL) {
t = icalproperty_get_dtstart(p);
event_tt = icaltime_as_timet(t);
+ if (t.is_date) all_day_event = 1;
fmt_time(timestring, event_tt);
- memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+
+ if (all_day_event) {
+ memcpy(&event_tm, gmtime(&event_tt), sizeof(struct tm));
+ }
+ else {
+ memcpy(&event_tm, localtime(&event_tt), sizeof(struct tm));
+ }
+
if ( (event_tm.tm_year == today_tm.tm_year)
&& (event_tm.tm_mon == today_tm.tm_mon)
&& (event_tm.tm_mday == today_tm.tm_mday)
) {
- if (t.is_date) all_day_event = 1;
p = icalcomponent_get_first_property(
WC->disp_cal[i],
#define SLEEPING 180 /* TCP connection timeout */
#define WEBCIT_TIMEOUT 900 /* WebCit session timeout */
#define PORT_NUM 2000 /* port number to listen on */
-#define SERVER "WebCit v5.03" /* who's in da house */
+#define SERVER "WebCit v5.04" /* who's in da house */
#define DEVELOPER_ID 0
#define CLIENT_ID 4
-#define CLIENT_VERSION 503 /* This version of WebCit */
+#define CLIENT_VERSION 504 /* This version of WebCit */
#define MINIMUM_CIT_VERSION 611 /* min required Citadel vers */
#define DEFAULT_HOST "localhost" /* Default Citadel server */
#define DEFAULT_PORT "504"