]> err.no Git - scalable-opengroupware.org/commitdiff
month view completed.
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 23 Jun 2004 17:39:28 +0000 (17:39 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 23 Jun 2004 17:39:28 +0000 (17:39 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@61 d1b88da0-ebda-0310-925b-ed51d893ca5b

ZideStore/UI-X/ChangeLog
ZideStore/UI-X/Common/calendar.css
ZideStore/UI-X/Scheduler/UIxCalMonthOverview.m
ZideStore/UI-X/Scheduler/UIxCalMonthOverview.wox

index 6d4b7a55bb8b0f336045757388e2d443ea68803b..df753d1f42502c7a9f21a5db0db86a3d1e09b84d 100644 (file)
@@ -1,3 +1,9 @@
+2004-06-23  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * UIxCalMonthOverview.[m,wox]: completed month view. Turned out to
+         be much more difficult to improve with style sheets than expected.
+         Requires version 4.2.45 of WEExtensions.
+
 2004-06-22  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * Refactoring: Renamed everything from OGo to UIx in order to avoid
index 00724bf41fc0882bcd2ebbd03376c7c5c403486d..364b9a0b4f297ba8a06c0e74773a806c53030f33 100644 (file)
   letter-spacing:  0pt;
   text-decoration: none;
 }
+
+.monthoverview {
+  color:            #000000;
+  font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  font-size:        10pt;
+  letter-spacing:   0pt;
+  padding:          2px;
+}
+
+.monthoverview a {
+  color:            #0033cc;
+  font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  font-size:        7pt;
+  font-style:       normal;
+  font-weight:      normal;
+  letter-spacing:   0pt;
+  text-decoration:  none;
+}
+
+.monthoverview a:hover {
+  text-decoration:  underline;
+}
+
+.monthoverview_title {
+  background-color: #d2d2cc;
+  text-align:       center;
+}
+
+.monthoverview_week {
+  background-color: #d2d2cc;
+  width:            16pt;
+  text-align:       center;
+  vertical-align:   middle;
+}
+
+.monthoverview_week a {
+  color:            #000000;
+  font-size:        10pt;
+}
+
+.monthoverview_week_hilite {
+  background-color: #fffff0;
+  width:            16pt;
+  text-align:       center;
+  vertical-align:   middle;
+}
+
+.monthoverview_week_hilite a {
+  color:            #000000;
+  font-size:        10pt;
+}
+
+.monthoverview_content {
+  background-color: #e8e8e0;
+  font-size:        9pt;
+  height:           60;
+  vertical-align:   top;
+}
+
+.monthoverview_content a {
+  font-style:       italic;
+  font-weight:      bold;
+}
+
+.monthoverview_content_hilite {
+  background-color: #fffff0;
+  font-size:        9pt;
+  height:           60;
+  vertical-align:   top;
+}
+
+.monthoverview_content_hilite a {
+  font-style:       italic;
+  font-weight:      bold;
+}
+
+.monthoverview_content_dimmed {
+  background-color: #d2d2cc;
+  font-size:        9pt;
+  height:           60;
+  vertical-align:   top;
+}
+
+.monthoverview_content_dimmed a {
+  font-style:       normal;
+  font-weight:      normal;
+}
+
+.monthoverview_day a {
+  color:            #000000;
+  font-family:      Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  font-size:        12pt;
+}
+
+.monthoverview_day_new a {
+  font-style:       normal;
+  font-weight:      normal;
+}
+
+.monthoverview_day_new a:hover {
+  font-style:       normal;
+  font-weight:      normal;
+  color:            #ff0000;
+}
+
+.monthoverview_content_link {
+  font-style:       normal;
+  font-weight:      normal;
+}
index ea2d061f0a9e994af782bb6dd676fdb10714e4a8..4d11a3cb2db527f356535820e83ffa81fecff36d 100644 (file)
@@ -1,9 +1,15 @@
 // $Id$
 
 #include "UIxCalMonthView.h"
+#include <NGExtensions/NGExtensions.h>
+
 
 @interface UIxCalMonthOverview : UIxCalMonthView
 {
+    int dayIndex;
+    int dayOfWeek;
+    int weekOfYear;
+    NSCalendarDate *currentWeekStart;
 }
 
 @end
 
 @implementation UIxCalMonthOverview
 
+- (void)dealloc {
+    [self->currentWeekStart release];
+    [super dealloc];
+}
+
+- (void)setDayIndex:(int)_idx {
+    self->dayIndex = _idx;
+}
+
+- (int)dayIndex {
+    return self->dayIndex;
+}
+
+- (void)setDayOfWeek:(int)_day {
+    self->dayOfWeek = _day;
+}
+
+- (int)dayOfWeek {
+    return self->dayOfWeek;
+}
+
+- (void)setCurrentWeekStartDate:(NSCalendarDate *)_date {
+    ASSIGN(self->currentWeekStart, _date);
+}
+
+- (NSCalendarDate *)currentWeekStartDate {
+    return self->currentWeekStart;
+}
+
+- (void)setWeekOfYear:(int)_week {
+    NSCalendarDate *date;
+    
+    self->weekOfYear = _week;
+    date = [[self startDate] mondayOfWeek:self->weekOfYear];
+    [self setCurrentWeekStartDate:date];
+}
+
+- (int)weekOfYear {
+    return self->weekOfYear;
+}
+
+- (int)year {
+    return [[self startDate] yearOfCommonEra];
+}
+
+- (int)month {
+    return [[self startDate] monthOfYear];
+}
+
+- (NSString *)localizedNameOfDayOfWeek {
+    // TODO: move this to some locale method
+    static char *dayNames[] = {
+        "Sunday",
+        "Monday",
+        "Tuesday",
+        "Wednesday",
+        "Thursday",
+        "Friday",
+        "Saturday"
+    };
+    return [[[NSString alloc] initWithCString:
+        dayNames[self->dayOfWeek]] autorelease];
+}
+
+- (NSDictionary *)currentWeekQueryParameters {
+    return [self queryParametersBySettingSelectedDate:self->currentWeekStart];
+}
+
+
+/* style sheet */
+
+
+- (NSString *)weekStyle {
+    if([self->currentWeekStart isDateInSameWeek:[NSCalendarDate date]])
+        return @"monthoverview_week_hilite";
+    return @"monthoverview_week";
+}
+
+- (NSString *)contentStyle {
+    if([self->currentDay isToday])
+        return @"monthoverview_content_hilite";
+    else if([self->currentDay monthOfYear] != [[self startDate] monthOfYear])
+        return @"monthoverview_content_dimmed";
+    return @"monthoverview_content";
+}
+
+
+/* appointments */
+
+
 - (NSArray *)appointments {
   return [self fetchCoreInfos];
 }
index ebdd96301334345476e1241d2d4f4bdb58623595..f21dd3a529207327ba96bb6c230e2795cfbc2a90 100644 (file)
                  const:selection="month"
                  currentDate="selectedDate"
   >
+        <table border="0" cellpadding="4" width="100%" cellspacing="2">
+          <tr>
+            <td align="right" bgcolor="#e8e8e0">
+                <table border='0' cellpadding='0' cellspacing='1'>
+                    <tr>
+                        <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+                            <a class="button_auto" href="monthprintview" var:queryDictionary="queryParameters" target="SOGoPrintView">printview</a>
+                        </td>
+                        <td class="button_auto_env" nowrap="true" valign='middle' align='center'>
+                            <a class="button_auto" href="proposal" var:queryDictionary="queryParameters">proposal</a>
+                        </td>
+                    </tr>
+                </table>
+            </td>
+          </tr>
+        </table>
 
     <var:month-overview
       list="appointments"
       item="appointment"
-      index="index"
-      currentDay="selectedDate"
-
+      currentDay="currentDay"
+      index="dayIndex"
+      year="year"
+      month="month"
       const:startDateKey = "startDate"
       const:endDateKey   = "endDate"
 
-      const:titleColor   = "#7799FF"
-      const:contentColor = "#5577FF"
+      const:class="monthoverview"
+      contentStyle="contentStyle"
+      const:width="100%"
     >
-      <var:month>
-        <a var:href="appointmentViewURL"><var:string value="appointment.title" /></a>
-      </var:month>
-    </var:month-overview>
+      <var:month-info>
+        <var:if condition="hasHolidayInfo">
+            <var:string value="holidayInfo" const:class="monthoverview_holidayinfo" />
+        </var:if>
+        <var:foreach list="allDayApts" item="appointment">
+            <a var:href="appointmentViewURL"><var:string value="shortTextForApt" /></a>
+        </var:foreach>
+      </var:month-info>
+    <var:month-label const:orientation="top"
+                     dayOfWeek="dayOfWeek"
+                     const:class="monthoverview_title"
+    >
+        <var:string value="localizedNameOfDayOfWeek" />
+    </var:month-label>
+    <var:month-label const:orientation="left"
+                     weekOfYear="weekOfYear"
+                     class="weekStyle"
+    >
+        <a href="weekoverview"
+           var:queryDictionary="currentWeekQueryParameters"
+        ><var:string value="weekOfYear" /></a>
+    </var:month-label>
+    
+        <var:month-title class="contentStyle">
+            <span class="monthoverview_day">
+                <a href="dayoverview"
+                   var:queryDictionary="currentDayQueryParameters"
+                ><var:string value="currentDay.dayOfMonth" /></a>
+            </span>
+            <br />
+            <span class="monthoverview_day_new">
+                <a href="proposal"
+                   var:queryDictionary="currentDayQueryParameters"
+                >[new]</a>
+            </span>
+        </var:month-title>
 
+        <var:month>
+            <a var:href="appointmentViewURL" class="monthoverview_content_link"><var:string value="appointment.title" /></a>
+        </var:month>
+    </var:month-overview>
   </var:component>
   </td>
   </tr>