]> err.no Git - scalable-opengroupware.org/commitdiff
new UI element and refinement
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 14 Jun 2004 17:35:08 +0000 (17:35 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Mon, 14 Jun 2004 17:35:08 +0000 (17:35 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@35 d1b88da0-ebda-0310-925b-ed51d893ca5b

ZideStore/UI-X/ChangeLog
ZideStore/UI-X/Common/calendar.css
ZideStore/UI-X/Scheduler/GNUmakefile
ZideStore/UI-X/Scheduler/OGoCalDateLabel.m [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalDateLabel.wox [new file with mode: 0644]
ZideStore/UI-X/Scheduler/OGoCalMonthOverview.wox
ZideStore/UI-X/Scheduler/OGoCalMonthView.m
ZideStore/UI-X/Scheduler/OGoCalSelectTab.m
ZideStore/UI-X/Scheduler/OGoCalWeekOverview.wox

index 0745e5f6d838c20a426277a54f7b6f5f2a9c3025..54359b87c650a2adba95b023b4bcd9efe2dff9d9 100644 (file)
@@ -6,6 +6,24 @@
 
        * added aggregate project for UI-X
 
+2004-06-14  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * Common/calendar.css: new date_label (unused)
+
+       * Scheduler/OGoCalSelectTab.m: finished all labels
+
+       * Scheduler/OGoCalDateLabel.m, Scheduler/OGoCalDateLabel.wox: new
+         component for rendering the correct date label based on startDate,
+         endDate and selection
+
+       * Scheduler/OGoCalMonthView.m: prev/next month corrected
+
+       * Scheduler/OGoCalMonthOverview.wox: uses date label and tabs now
+
+       * Scheduler/OGoCalWeekOverview.wox: completed layout
+
+       * Scheduler/GNUmakefile: new component added
+
 2004-06-14  Marcus Mueller  <znek@mulle-kybernetik.com>
 
        * Common/UIxTabView.[hm]: more stylesheet support via headerStyle
index 74c25bfebce48bfe4a7a1752094a81354a5e4499..20bc8697ebc9ea99d2fd852b7511802e64590018 100644 (file)
@@ -1,7 +1,15 @@
+.date_label {
+  color:            #06348b;
+  font-family:     Arial, Helvetica, Verdana, Geneva, Tahoma, sans-serif;
+  font-size:        12pt;
+  font-weight:      bold;
+}
+
 .weekoverview_title {
   color:            #000000;
   background-color: #AAAAAA;
 }
+
 .weekoverview_content {
   color:            #FFFFFF;
   background-color: #DDDDDD;
index f890bcad8b1d5c4bc2a95b3f67b3b1ef833a5ad7..d841062ac037c643459ea28f410aaaa2a1d3ef0d 100644 (file)
@@ -19,6 +19,7 @@ SchedulerUI_OBJC_FILES = \
        OGoCalMonthOverview.m   \
        OGoAppointmentView.m    \
        OGoCalSelectTab.m \
+       OGoCalDateLabel.m \
 
 SchedulerUI_RESOURCE_FILES += \
        Version                         \
@@ -29,6 +30,7 @@ SchedulerUI_RESOURCE_FILES += \
        OGoCalMonthOverview.wox         \
        OGoAppointmentView.wox          \
        OGoCalSelectTab.wox \
+       OGoCalDateLabel.wox \
        images/next_week.gif            \
        images/previous_week.gif        \
        
diff --git a/ZideStore/UI-X/Scheduler/OGoCalDateLabel.m b/ZideStore/UI-X/Scheduler/OGoCalDateLabel.m
new file mode 100644 (file)
index 0000000..46c7191
--- /dev/null
@@ -0,0 +1,113 @@
+/*
+  Copyright (C) 2000-2004 SKYRIX Software AG
+
+  This file is part of OGo
+
+  OGo is free software; you can redistribute it and/or modify it under
+  the terms of the GNU Lesser General Public License as published by the
+  Free Software Foundation; either version 2, or (at your option) any
+  later version.
+
+  OGo is distributed in the hope that it will be useful, but WITHOUT ANY
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or
+  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+  License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with OGo; see the file COPYING.  If not, write to the
+  Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+  02111-1307, USA.
+*/
+// $Id$
+
+
+#include <NGObjWeb/NGObjWeb.h>
+
+
+@interface OGoCalDateLabel : WOComponent
+{
+    NSString *selection;
+    NSCalendarDate *startDate;
+    NSCalendarDate *endDate;
+}
+
+- (NSString *)dayLabel;
+- (NSString *)weekLabel;
+- (NSString *)monthLabel;
+- (NSString *)yearLabel;
+
+@end
+
+
+@implementation OGoCalDateLabel
+
+- (void)dealloc {
+    [self->selection release];
+    [self->startDate release];
+    [self->endDate release];
+    [super dealloc];
+}
+
+- (void)setSelection:(NSString *)_selection {
+    ASSIGN(self->selection, _selection);
+}
+
+- (NSString *)selection {
+    return self->selection;
+}
+
+- (void)setStartDate:(NSCalendarDate *)_date {
+    ASSIGN(self->startDate, _date);
+}
+
+- (NSCalendarDate *)startDate {
+    return self->startDate;
+}
+
+- (void)setEndDate:(NSCalendarDate *)_date {
+    ASSIGN(self->endDate, _date);
+}
+
+- (NSCalendarDate *)endDate {
+    return self->endDate;
+}
+
+- (NSString *)label {
+    NSString *key = [self selection];
+    if([key isEqualToString:@"day"])
+        return [self dayLabel];
+    else if([key isEqualToString:@"week"])
+        return [self weekLabel];
+    else if([key isEqualToString:@"month"])
+        return [self monthLabel];
+    return [self yearLabel];
+}
+
+- (NSString *)dayLabel {
+    return [self->startDate descriptionWithCalendarFormat:@"%Y-%m-%d"];
+}
+
+- (NSString *)weekLabel {
+    NSString *label;
+    
+    label = [self->startDate descriptionWithCalendarFormat:@"%B %Y"];
+    if([self->startDate monthOfYear] != [self->endDate monthOfYear]) {
+        NSString *ext;
+        
+        ext = [self->endDate descriptionWithCalendarFormat:@"%B %Y"];
+        label = [NSString stringWithFormat:@"<nobr>%@ / %@</nobr>",
+                                            label,
+                                            ext];
+    }
+    return label;
+}
+
+- (NSString *)monthLabel {
+    return [self->startDate descriptionWithCalendarFormat:@"%B %Y"];
+}
+
+- (NSString *)yearLabel {
+    return [self->startDate descriptionWithCalendarFormat:@"%Y"];
+}
+
+@end
diff --git a/ZideStore/UI-X/Scheduler/OGoCalDateLabel.wox b/ZideStore/UI-X/Scheduler/OGoCalDateLabel.wox
new file mode 100644 (file)
index 0000000..8dfff7b
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version='1.0' standalone='yes'?>
+
+<var:string xmlns="http://www.w3.org/1999/xhtml"
+            xmlns:var="http://www.skyrix.com/od/binding"
+            xmlns:const="http://www.skyrix.com/od/constant"
+            xmlns:rsrc="OGo:url"
+            var:value="label"
+            const:escapeHTML="NO"
+/>
\ No newline at end of file
index 6b98aeecbfe7a13a3551ae8ad025d32973c6adde..e964ea5e4fcc3d089d4b50a5fdc5ebc7e4f02de5 100644 (file)
@@ -4,23 +4,53 @@
   xmlns:var="http://www.skyrix.com/od/binding"
   xmlns:const="http://www.skyrix.com/od/constant"
 >
-  <a href="weekoverview">week</a>
-  <br />
-    OGo ZideStore Server - <var:string value="name"/>
-    <br />
-    Client: <var:string value="clientObject"/>
-    <br />
-    Appointments: #<var:string value="appointments.count"/>
-    from <var:string value="startDate" />
-    to   <var:string value="endDate" />
-    <br />
 
-    <hr />
-    
-    <a var:href="prevMonthURL"><var:entity const:name="lt" /><var:entity const:name="lt" /></a>
-    <a var:href="thisMonthURL">*</a>
-    <a var:href="nextMonthURL"><var:entity const:name="gt" /><var:entity const:name="gt" /></a>
-    <br />
+  <table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
+  <tr>
+  <td class="wintitle">
+  <table cellpadding="0" cellspacing="0" width="100%">
+  <tr>
+  <td width="5"/>
+  <td class="wintitle"><var:component className="OGoCalDateLabel" startDate="startDate" endDate="endDate" const:selection="month" /></td>
+  <td width="36" align="right" valign="center">
+  <var:component className="OGoWinClose" />
+  </td>
+  </tr>
+  </table>
+  </td>
+  </tr>
+
+  <tr>
+  <td id="skywinbodycell" class="wincontent">
+    <table border="0" cellpadding="0" cellspacing="0" width="100%">
+    <tr bgcolor="#E0E0E0">
+    <td align="left" valign="middle" width="80%">other stuff</td><!-- 99% -->
+    <td align="right">
+    <table border="0">
+    <tr>
+    <td align="right" valign="middle">
+    <a var:href="prevMonthURL"><img rsrc:src="previous_week.gif" alt="previous month" border="0"/></a></td>
+    <td align="right" valign="middle">
+    <a var:href="thisMonthURL" class="button_auto">this<var:entity const:name="nbsp"/>month</a>
+    </td>
+    <td align="right" valign="middle">
+    <a var:href="nextMonthURL"><img rsrc:src="next_week.gif" alt="next month" border="0"/></a>
+    </td>
+    </tr>
+    </table>
+    </td>
+    </tr>
+    </table>
+  </td>
+  </tr>
+
+  <tr>
+  <td id="skywinbodycell" class="wincontent">
+  <table border="0" width="100%" cellpadding="0" cellspacing="0">
+  <tr>
+  <td colspan="2">
+  <var:component className="OGoCalSelectTab" const:selection="month" currentDate="startDate">
+
     <var:month-overview
       list="appointments"
       item="appointment"
       </var:month>
     </var:month-overview>
 
+  </var:component>
+  </td>
+  </tr>
+  <tr bgcolor="#F5F5E9">
+  <td align="left" width="10"><var:entity const:name="nbsp"/></td>
+  <td align="right"><img border="0" alt="" rsrc:src="corner_right.gif"/></td>
+  </tr>
+  <tr>
+  <td colspan="2" bgcolor="#F5F5E9">
+  <table border="0" width="100%" cellpadding="10" cellspacing="0">
+  <tr/>
+  </table>
+  </td>
+  </tr>
+  </table>
+  </td>
+  </tr>
+  </table>
+
+<!--
+    <hr />
+    OGo ZideStore Server - <var:string value="name"/>
+    <br />
+    Client: <var:string value="clientObject"/>
+    <br />
+    Appointments: #<var:string value="appointments.count"/>
+    from <var:string value="startDate" />
+    to   <var:string value="endDate" />
+    <br />
+
+
     <hr />
 
     Appointments: 
     <var:component className="OGoAptTableView" appointments="appointments"/>
-
+    -->
     <!-- pre><var:string value="appointments" const:insertBR="YES"/></pre -->
 </var:component>
index a1496bce1aecd26d9bf9bb237345ff7df6c093e8..eb6ba7e197bc976316d5a176a57264ecadc071f3 100644 (file)
 
 - (NSString *)prevMonthURL {
   NSCalendarDate *newMonthDate;
-  
-  newMonthDate = [[self startDate] dateByAddingYears:0 months:0 days:-31
-                                  hours:0 minutes:0 seconds:0];
+
+  newMonthDate = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
+                                                     months:-1
+                                                     days:0
+                                                     hours:0
+                                                     minutes:0
+                                                     seconds:0];
   return [self dateNavigationURLWithNewStartDate:newMonthDate];
 }
 
 - (NSString *)nextMonthURL {
   NSCalendarDate *newMonthDate;
-  
-  newMonthDate = [[self startDate] dateByAddingYears:0 months:0 days:31
-                                  hours:0 minutes:0 seconds:0];
-  return [self dateNavigationURLWithNewStartDate:newMonthDate];
+
+  newMonthDate = [[[self startDate] firstDayOfMonth] dateByAddingYears:0
+                                                     months:1
+                                                     days:0
+                                                     hours:0
+                                                     minutes:0
+                                                     seconds:0];
+    return [self dateNavigationURLWithNewStartDate:newMonthDate];
 }
 
 - (NSString *)thisMonthURL {
index e79e9f2214fdc6fba908b97359df46202b4039c0..ae426b74c8caf7b96c69b59e78eeb99c47be644d 100644 (file)
@@ -22,6 +22,7 @@
 
 
 #include <NGObjWeb/NGObjWeb.h>
+#include <NGExtensions/NGExtensions.h>
 
 
 @interface OGoCalSelectTab : WOComponent
 }
 
 - (NSString *)dayLabel {
-    return [self->currentDate descriptionWithCalendarFormat:@"%d"];
+    NSCalendarDate *date;
+
+    if([[self selection] isEqualToString:@"day"]) {
+        date = self->currentDate;
+    }
+    else {
+        date = [NSCalendarDate date];
+        if(! [self->currentDate isDateInSameWeek:date])
+            date = [self->currentDate mondayOfWeek];
+    }
+    
+    return [date descriptionWithCalendarFormat:@"%d"];
 }
 
 - (NSString *)weekLabel {
-    return @"TODO: week";
+    return [NSString stringWithFormat:@"Week %d", [self->currentDate weekOfYear]];
 }
 
 - (NSString *)monthLabel {
-    return @"TODO: month";
+    return [self->currentDate descriptionWithCalendarFormat:@"%B"];
 }
 
 - (NSString *)yearLabel {
-    return @"TODO: year";
+    return [self->currentDate descriptionWithCalendarFormat:@"%Y"];
 }
 
 @end
index f14b92cb6f15d356f3a66ee472cbb2b11a9cbc73..73699bea515333b43844be849e2f59d92c59e419 100644 (file)
@@ -6,11 +6,25 @@
                xmlns:uix="OGo:uix"
                className="OGoPageFrame"
                title="name">
-    <br/>
-    OGo ZideStore Server - <var:string value="name"/><br/>
-    Client: <var:string value="clientObject"/><br/>
-    Appointments: #<var:string value="appointments.count"/><br/>
-    <hr/>
+
+  <!-- $Id: SkyNews.html,v 1.3 2003/12/22 16:53:55 helge Exp $ -->
+  <table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
+  <tr>
+  <td class="wintitle">
+  <table cellpadding="0" cellspacing="0" width="100%">
+  <tr>
+  <td width="5"/>
+  <td class="wintitle"><var:component className="OGoCalDateLabel" startDate="startDate" endDate="endDate" const:selection="week" /></td>
+  <td width="36" align="right" valign="center">
+  <var:component className="OGoWinClose" />
+  </td>
+  </tr>
+  </table>
+  </td>
+  </tr>
+
+  <tr>
+  <td id="skywinbodycell" class="wincontent">
     <table border="0" cellpadding="0" cellspacing="0" width="100%">
     <tr bgcolor="#E0E0E0">
     <td align="left" valign="middle" width="80%">other stuff</td><!-- 99% -->
     </td>
     </tr>
     </table>
-    <br/>
-    
-  <!-- $Id: SkyNews.html,v 1.3 2003/12/22 16:53:55 helge Exp $ -->
-  <table id="skywintable" class="wintable" cellspacing="0" cellpadding="5" width="100%">
-  <tr>
-  <td class="wintitle">
-  <table cellpadding="0" cellspacing="0" width="100%">
-  <tr>
-  <td width="5"/>
-  <td class="wintitle">TODO:Date</td>
-  <td width="36" align="right" valign="center">
-  <var:component className="OGoWinClose" />
-  </td>
-  </tr>
-  </table>
   </td>
   </tr>
+
   <tr>
   <td id="skywinbodycell" class="wincontent">
   <table border="0" width="100%" cellpadding="0" cellspacing="0">
   <tr>
   <td colspan="2">
   <var:component className="OGoCalSelectTab" const:selection="week" currentDate="startDate">
-  week content, right?
+  <var:week-overview list="appointments" item="appointment" weekStart="startDate" const:startDateKey="startDate" const:endDateKey="endDate" const:titleStyle="weekoverview_title" const:contentStyle="weekoverview_content">
+  <var:week>
+  <a var:href="appointmentViewURL"><var:string value="appointment.title"/></a>
+  </var:week>
+  </var:week-overview>
   </var:component>
   </td>
   </tr>
   </td>
   </tr>
   </table>
-  <var:week-overview list="appointments" item="appointment" weekStart="startDate" const:startDateKey="startDate" const:endDateKey="endDate" const:titleStyle="weekoverview_title" const:contentStyle="weekoverview_content">
-  <var:week>
-  <a var:href="appointmentViewURL"><var:string value="appointment.title"/></a>
-  </var:week>
-  </var:week-overview>
+  <!--
   <hr/>
     
     Appointments: 
     <var:component className="OGoAptTableView" appointments="appointments"/>
+  -->
     <!-- pre><var:string value="appointments" const:insertBR="YES"/></pre -->
+
 </var:component>