]> code.citadel.org Git - citadel.git/blobdiff - webcit/calendar_view.c
* Created IsEmptyStr define to be used rather then using some weird strlen constructs
[citadel.git] / webcit / calendar_view.c
index 798579c7ec18ab9e0805951dcbb50430750f3150..54ebc2be1432340600fb1202575a3e69da6bdeb1 100644 (file)
@@ -139,18 +139,23 @@ void calendar_month_view_display_events(time_t thetime) {
                                                                fmt_date(buf, tt, 1);
                                                                wprintf("<i>%s</i> %s<br>",
                                                                        _("Starting date/time:"), buf);
+
+                                                               /* Embed the 'show end date/time' loop inside here so it
+                                                                * only executes if this is NOT an all day event.
+                                                                */
+                                                               q = icalcomponent_get_first_property(WC->disp_cal[i].cal,
+                                                                                                       ICAL_DTEND_PROPERTY);
+                                                               if (q != NULL) {
+                                                                       t = icalproperty_get_dtend(q);
+                                                                       tt = icaltime_as_timet(t);
+                                                                       fmt_date(buf, tt, 1);
+                                                                       wprintf("<i>%s</i> %s<br>",
+                                                                               _("Ending date/time:"), buf);
+                                                               }
+
                                                        }
                                                }
                                        
-                                               q = icalcomponent_get_first_property(WC->disp_cal[i].cal,
-                                                                                       ICAL_DTEND_PROPERTY);
-                                               if (q != NULL) {
-                                                       t = icalproperty_get_dtend(q);
-                                                       tt = icaltime_as_timet(t);
-                                                       fmt_date(buf, tt, 1);
-                                                       wprintf("<i>%s</i> %s<br>",
-                                                               _("Ending date/time:"), buf);
-                                               }
                                        }
 
                                        q = icalcomponent_get_first_property(
@@ -424,8 +429,7 @@ void calendar_month_view(int year, int month, int day) {
         * being rendered.  See http://www.shaftek.org/blog/archives/000212.html
         * for more information.
         */ 
-       wprintf("<script type=\"text/javascript\" src=\"static/BubbleTooltips.js\"></script>\n"
-               "<script type=\"text/javascript\">"
+       wprintf("<script type=\"text/javascript\">"
                " setTimeout(\"btt_enableTooltips('inner_month')\", 1); "
                "</script>\n"
        );
@@ -518,7 +522,7 @@ void calendar_brief_month_view(int year, int month, int day) {
                if ((i % 7) == 0) {
                        wc_strftime(&weeknumber[0], sizeof(weeknumber), "%U", &tm);
                        wprintf("<table border='0' bgcolor=\"#EEEECC\" width='100%'> <tr><th colspan='4'>%s %s</th></tr>"
-                                       "   <tr><td>%s</td><td width='70%'>%s</td><td>%s</td><td>%s</td></tr>\n",
+                                       "   <tr><td>%s</td><td width=70%%>%s</td><td>%s</td><td>%s</td></tr>\n",
                                        _("Week"), 
                                        weeknumber,
                                        _("Hours"),
@@ -671,9 +675,9 @@ void calendar_day_view(int year, int month, int day) {
 
        get_preference("calhourformat", calhourformat, sizeof calhourformat);
        get_preference("daystart", daystart_str, sizeof daystart_str);
-       if (strlen(daystart_str) > 0) daystart = atoi(daystart_str);
+       if (!IsEmptyStr(daystart_str)) daystart = atoi(daystart_str);
        get_preference("dayend", dayend_str, sizeof dayend_str);
-       if (strlen(dayend_str) > 0) dayend = atoi(dayend_str);
+       if (!IsEmptyStr(dayend_str)) dayend = atoi(dayend_str);
        
 
        /** Figure out the dates for "yesterday" and "tomorrow" links */
@@ -911,12 +915,12 @@ void do_calendar_view(void) {
        day = tm.tm_mday;
 
        /** Now see if a date was specified */
-       if (strlen(bstr("year")) > 0) year = atoi(bstr("year"));
-       if (strlen(bstr("month")) > 0) month = atoi(bstr("month"));
-       if (strlen(bstr("day")) > 0) day = atoi(bstr("day"));
+       if (!IsEmptyStr(bstr("year"))) year = atoi(bstr("year"));
+       if (!IsEmptyStr(bstr("month"))) month = atoi(bstr("month"));
+       if (!IsEmptyStr(bstr("day"))) day = atoi(bstr("day"));
 
        /** How would you like that cooked? */
-       if (strlen(bstr("calview")) > 0) {
+       if (!IsEmptyStr(bstr("calview"))) {
                strcpy(calview, bstr("calview"));
        }
        else {
@@ -1012,7 +1016,7 @@ void do_tasks_view(void) {
        icalproperty *p;
 
        wprintf("<div class=\"fix_scrollbar_bug\">"
-               "<table border=0 cellspacing=0 width=100%% bgcolor=\"#FFFFFF\">\n<tr>\n"
+               "<table class=\"calendar_view_background\">\n<tr>\n"
                "<th>");
        wprintf(_("Name of task"));
        wprintf("</th><th>");