]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_view.c
* Use the new icons in more places.
[citadel.git] / webcit / calendar_view.c
index f5ec03b6f2f001070a3cc514dc6f295ec53cb616..5bfe3497d45faefa9ae8bdae9c0acd17f3065939 100644 (file)
@@ -166,7 +166,7 @@ void calendar_month_view(int year, int month, int day) {
        localtime_r(&previous_month, &tm);
        wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
                (int)(tm.tm_year)+1900, tm.tm_mon + 1);
-       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/back.gif\" BORDER=0></A>\n");
+       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/prevdate_32x.gif\" BORDER=0></A>\n");
 
        wprintf("&nbsp;&nbsp;"
                "<FONT SIZE=+1 COLOR=\"#FFFFFF\">"
@@ -177,7 +177,7 @@ void calendar_month_view(int year, int month, int day) {
        localtime_r(&next_month, &tm);
        wprintf("<A HREF=\"readfwd?calview=month&year=%d&month=%d&day=1\">",
                (int)(tm.tm_year)+1900, tm.tm_mon + 1);
-       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/forward.gif\" BORDER=0></A>\n");
+       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/nextdate_32x.gif\" BORDER=0></A>\n");
 
        wprintf("</TD></TR></TABLE>\n");
 
@@ -315,7 +315,9 @@ void calendar_day_view_display_events(int year, int month,
 void calendar_day_view(int year, int month, int day) {
        int hour;
        struct icaltimetype today, yesterday, tomorrow;
+       char calhourformat[16];
 
+       get_preference("calhourformat", calhourformat, sizeof calhourformat);
 
        /* Figure out the dates for "yesterday" and "tomorrow" links */
 
@@ -365,10 +367,17 @@ void calendar_day_view(int year, int month, int day) {
                        "&year=%d&month=%d&day=%d&hour=%d&minute=0\">",
                        year, month, day, hour
                );
-               wprintf("%d:00%s</A> ",
-                       (hour <= 12 ? hour : hour-12),
-                       (hour < 12 ? "am" : "pm")
-               );
+
+               if (!strcasecmp(calhourformat, "24")) {
+                       wprintf("%2d:00</A> ", hour);
+               }
+               else {
+                       wprintf("%d:00%s</A> ",
+                               (hour <= 12 ? hour : hour-12),
+                               (hour < 12 ? "am" : "pm")
+                       );
+               }
+
                wprintf("</TD><TD BGCOLOR=\"#FFFFFF\" VALIGN=TOP>");
 
                /* put the data here, stupid */
@@ -403,7 +412,7 @@ void calendar_day_view(int year, int month, int day) {
        wprintf("<TD ALIGN=CENTER>");
        wprintf("<A HREF=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
                yesterday.year, yesterday.month, yesterday.day);
-       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/back.gif\" BORDER=0></A>");
+       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/prevdate_32x.gif\" BORDER=0></A>");
        wprintf("</TD>");
 
        /* Today's date */
@@ -418,7 +427,7 @@ void calendar_day_view(int year, int month, int day) {
        wprintf("<TD ALIGN=CENTER>");
        wprintf("<A HREF=\"readfwd?calview=day&year=%d&month=%d&day=%d\">",
                tomorrow.year, tomorrow.month, tomorrow.day);
-       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/forward.gif\""
+       wprintf("<IMG ALIGN=MIDDLE SRC=\"/static/nextdate_32x.gif\""
                " BORDER=0></A>\n");
        wprintf("</TD>");
 
@@ -642,6 +651,8 @@ void do_tasks_view(void) {
                        WC->disp_cal[i].cal_msgnum );
                urlescputs(WC->wc_roomname);
                wprintf("\">");
+               wprintf("<IMG ALIGN=MIDDLE "
+                       "SRC=\"/static/taskmanag_16x.gif\" BORDER=0>&nbsp;");
                if (p != NULL) {
                        escputs((char *)icalproperty_get_comment(p));
                }