* 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
+.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;
OGoCalMonthOverview.m \
OGoAppointmentView.m \
OGoCalSelectTab.m \
+ OGoCalDateLabel.m \
SchedulerUI_RESOURCE_FILES += \
Version \
OGoCalMonthOverview.wox \
OGoAppointmentView.wox \
OGoCalSelectTab.wox \
+ OGoCalDateLabel.wox \
images/next_week.gif \
images/previous_week.gif \
--- /dev/null
+/*
+ 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
--- /dev/null
+<?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
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>
- (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 {
#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
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>