]> err.no Git - scalable-opengroupware.org/commitdiff
new component
authorznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 17:13:21 +0000 (17:13 +0000)
committerznek <znek@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Sun, 15 Aug 2004 17:13:21 +0000 (17:13 +0000)
git-svn-id: http://svn.opengroupware.org/SOGo/trunk@226 d1b88da0-ebda-0310-925b-ed51d893ca5b

SOGo/SOGo.xcode/project.pbxproj
SOGo/UI/Scheduler/ChangeLog
SOGo/UI/Scheduler/GNUmakefile
SOGo/UI/Scheduler/UIxAppointmentEditor.m
SOGo/UI/Scheduler/UIxAppointmentEditor.wox
SOGo/UI/Scheduler/UIxTimeSelector.m [new file with mode: 0644]
SOGo/UI/Scheduler/UIxTimeSelector.wox [new file with mode: 0644]
SOGo/UI/Scheduler/Version

index e15dba32ea3277573cdda80cf6f8dff9ed75ba64..e5ce1bda4aa253af839225304fb721c7a7e4f2e6 100644 (file)
                                AD73BE9306CF969100226A2D,
                                AD73BED806CFA0FD00226A2D,
                                AD73BED706CFA0FD00226A2D,
+                               AD73BF6C06CFB4CE00226A2D,
+                               AD73BF6B06CFB4CE00226A2D,
                        );
                        isa = PBXGroup;
-                       name = UIxDatePicker;
+                       name = "Date / Time";
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BF6B06CFB4CE00226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = text.xml;
+                       path = UIxTimeSelector.wox;
+                       refType = 4;
+                       sourceTree = "<group>";
+               };
+               AD73BF6C06CFB4CE00226A2D = {
+                       fileEncoding = 4;
+                       isa = PBXFileReference;
+                       lastKnownFileType = sourcecode.c.objc;
+                       path = UIxTimeSelector.m;
                        refType = 4;
                        sourceTree = "<group>";
                };
index cf61cebf95e7abec64da9e1f9ac2afa65434147c..a03d2f807bbf0952648ee1cb8660c2fd730c3651 100644 (file)
@@ -1,3 +1,12 @@
+2004-08-15  Marcus Mueller  <znek@mulle-kybernetik.com>
+
+       * v0.9.43
+
+       * UIxTimeSelector.[wox,m]: new component for selecting the time part
+         of a given date.
+
+       * UIxAppointmentEditor.[wox,m]: uses new UIxTimeSelector
+
 2004-08-15  Helge Hess  <helge.hess@skyrix.com>
 
        * v0.9.42
index 7a0c86a8188ffcc4aa7236b647a312983eea43a5..b5e64b4c1af814cc01d9100002339f6a25e072c7 100644 (file)
@@ -44,6 +44,7 @@ SchedulerUI_OBJC_FILES =              \
        UIxAppointmentProposal.m        \
        UIxDatePicker.m                 \
        UIxDatePickerScript.m           \
+       UIxTimeSelector.m               \
 
 SchedulerUI_RESOURCE_FILES += \
        Version         \
@@ -72,6 +73,7 @@ SchedulerUI_RESOURCE_FILES +=         \
        UIxAppointmentProposal.wox      \
        UIxDatePicker.wox               \
        UIxDatePickerScript.wox         \
+       UIxTimeSelector.wox             \
 
 SchedulerUI_RESOURCE_FILES += \
        images/next_week.gif                    \
index cbeebb648387f837c853e28ae3bebac3424e829c..53a6fbcbc0f06384553134b807fd94f1975dff60 100644 (file)
   return s;
 }
 
+- (NSCalendarDate *)aptStartDate {
+    NSCalendarDate *date;
+
+    date = [[[[self appointment] startDate] copy] autorelease];
+    [date setTimeZone:[self viewTimeZone]];
+    return date;
+}
+
+- (NSCalendarDate *)aptEndDate {
+    NSCalendarDate *date;
+    
+    date = [[[[self appointment] endDate] copy] autorelease];
+    [date setTimeZone:[self viewTimeZone]];
+    return date;
+}
+
 - (BOOL)isNewAppointment {
   /* that doesn't work! (TODO: explain why!) */
   // TODO: is this actually used?
index 322dfa8c9a7bf60a72c5fccef4d51975a0f07460..46ab1be02ebc0d267b659be97903b01e67f79140 100644 (file)
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="text" name="startDate" 
-                         var:value="appointment.startDate" 
-                         const:dateformat="%Y-%m-%d %H:%M %Z" 
-                         const:size="40" />
+                  <var:component className="UIxDatePickerScript" />
+                  <var:component className="UIxTimeSelector"
+                                 const:timeID="startTime"
+                                 date="aptStartDate"
+                  />
+                  <var:component className="UIxDatePicker"
+                                 const:dateID="startDate"
+                                 date="aptStartDate"
+                                 label:label="browse start date"
+                  />
                 </span>
               </td>
             </tr>
               </td>
               <td align="left" bgcolor="#FFFFF0">
                 <span class="aptview_text">
-                  <input type="text" name="endDate" 
-                         var:value="appointment.endDate" 
-                         const:dateformat="%Y-%m-%d %H:%M %Z" 
-                         const:size="40" />
+                  <var:component className="UIxTimeSelector"
+                                 const:timeID="endTime"
+                                 date="aptEndDate"
+                  />
+                  <var:component className="UIxDatePicker"
+                                 const:dateID="endDate"
+                                 date="aptEndDate"
+                                 label:label="browse end date"
+                  />
                 </span>
               </td>
             </tr>
diff --git a/SOGo/UI/Scheduler/UIxTimeSelector.m b/SOGo/UI/Scheduler/UIxTimeSelector.m
new file mode 100644 (file)
index 0000000..84fd81f
--- /dev/null
@@ -0,0 +1,127 @@
+/*
+  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 UIxTimeSelector : WOComponent
+{
+    NSString *timeID;
+    NSCalendarDate *date;
+
+    id item;
+    NSArray *hours, *minutes;
+}
+
+- (NSArray *)hours;
+- (NSArray *)minutes;
+    
+@end
+
+#include "common.h"
+
+@implementation UIxTimeSelector
+
+- (void)dealloc {
+    [self->timeID release];
+    [self->date release];
+    [self->item release];
+    [super dealloc];
+}
+
+/* accessors */
+
+- (void)setTimeID:(NSString *)_timeID {
+    ASSIGN(self->timeID, _timeID);
+}
+- (NSString *)timeID {
+    return self->timeID;
+}
+
+- (void)setDate:(NSCalendarDate *)_date {
+    ASSIGN(self->date, _date);
+}
+- (NSCalendarDate *)date {
+    return self->date;
+}
+
+- (void)setItem:(id)_item {
+    ASSIGN(self->item, _item);
+}
+- (id)item {
+    return self->item;
+}
+
+- (NSString *)hoursName {
+    return [NSString stringWithFormat:@"%@_hours",
+        [self timeID]];
+}
+
+- (NSString *)minutesName {
+    return [NSString stringWithFormat:@"%@_minutes",
+        [self timeID]];
+}
+
+- (NSArray *)hours {
+    if(self->hours == nil) {
+        NSMutableArray *values;
+        unsigned i, count;
+        
+        count = 24;
+        values = [NSMutableArray arrayWithCapacity:count];
+        for(i = 0; i < count; i++) {
+            [values addObject:[NSNumber numberWithInt:i]];
+        }
+        self->hours = [values retain];
+    }
+    return self->hours;
+}
+
+- (NSArray *)minutes {
+    if(self->minutes == nil) {
+        NSMutableArray *values;
+        unsigned i, count;
+        
+        count = 60;
+        values = [NSMutableArray arrayWithCapacity:count];
+        for(i = 0; i < count; i++) {
+            [values addObject:[NSNumber numberWithInt:i]];
+        }
+        self->minutes = [values retain];
+    }
+    return self->minutes;
+}
+
+- (NSNumber *)selectedHour {
+    return [[self hours] objectAtIndex:[[self date] hourOfDay]];
+}
+
+- (NSNumber *)selectedMinute {
+    return [[self minutes] objectAtIndex:[[self date] minuteOfHour]];
+}
+
+- (NSString *)displayString {
+    return [NSString stringWithFormat:@"%02d", [item intValue]];
+}
+
+@end
diff --git a/SOGo/UI/Scheduler/UIxTimeSelector.wox b/SOGo/UI/Scheduler/UIxTimeSelector.wox
new file mode 100644 (file)
index 0000000..bf4a0ce
--- /dev/null
@@ -0,0 +1,20 @@
+<?xml version='1.0' standalone='yes'?>
+
+<span 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:id="timeID"
+>
+  <var:popup name="hoursName"
+             list="hours"
+             item="item"
+             displayString="displayString"
+             selection="selectedHour"
+  />:<var:popup name="minutesName"
+                list="minutes"
+                item="item"
+                displayString="displayString"
+                selection="selectedMinute"
+     />
+</span>
\ No newline at end of file
index 26001ebee4b5c4114cc6bfed17d6c89e45fdb896..08df903e80a30cf7862f01cd08d4f93daa5cb158 100644 (file)
@@ -1,6 +1,6 @@
 # $Id$
 
-SUBMINOR_VERSION:=42
+SUBMINOR_VERSION:=43
 
 # v0.9.41 requires libNGObjWeb     v4.2.431
 # v0.9.31 requires libWEExtensions v4.2.52