+2007-06-13 Wolfgang Sourdeau <wsourdeau@inverse.ca>
+
+ * UI/Scheduler/UIxCalListingActions.m ([UIxCalListingActions
+ -eventsListAction]): sort events from here.
+ ([UIxCalListingActions -tasksListAction]): sort tasks from here.
+
+ * SoObjects/SOGo/NSObject+AptComparison.[hm]: removed category
+ module, replaced with NSArray+Scheduler in UI/SchedulerUI/.
+
+ * SoObjects/Appointments/SOGoAppointmentFolder.m
+ ([SOGoAppointmentFolder
+ -fetchFields:_fieldsfromFolder:_folderfrom:_startDateto:_endDatecomponent:_component]):
+ no longer sort elements from here.
+
2007-06-12 Wolfgang Sourdeau <wsourdeau@inverse.ca>
* SoObjects/Mailer/SOGoMailObject.m ([SOGoMailObject
return nil;
}
- /* NOTE: why do we sort here?
- This probably belongs to UI but cannot be achieved as fast there as
- we can do it here because we're operating on a mutable array -
- having the apts sorted is never a bad idea, though
- */
- [ma sortUsingSelector: @selector (compareAptsAscending:)];
if (logger)
[self debugWithFormat:@"returning %i records", [ma count]];
LDAPSource.h \
SOGoPermissions.h \
SOGoLRUCache.h \
- NSObject+AptComparison.h \
WOContext+Agenor.h \
SOGoDAVRendererTypes.h \
NSArray+Utilities.h \
SOGoLRUCache.m \
LDAPUserManager.m \
LDAPSource.m \
- NSObject+AptComparison.m \
WOContext+Agenor.m \
SOGoDAVRendererTypes.m \
AgenorUserDefaults.m \
+++ /dev/null
-/*
- Copyright (C) 2004 SKYRIX Software AG
-
- This file is part of OpenGroupware.org.
-
- 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$
-
-#ifndef __SOGo_NSObject_AptComparison_H_
-#define __SOGo_NSObject_AptComparison_H_
-
-#import <Foundation/NSObject.h>
-
-@interface NSObject (SOGoAptComparison)
-
-- (NSComparisonResult)compareAptsAscending:(id)_other;
-
-@end
-
-#endif /* __SOGo_NSObject_AptComparison_H_ */
+++ /dev/null
-/*
- Copyright (C) 2004 SKYRIX Software AG
-
- This file is part of OpenGroupware.org.
-
- 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 "NSObject+AptComparison.h"
-#include <NGExtensions/NGCalendarDateRange.h>
-#include "common.h"
-
-@implementation NSObject (SOGoAptComparison)
-
-- (NSComparisonResult) compareAptsAscending: (id) _other
-{
- NSCalendarDate *sd, *ed;
- NGCalendarDateRange *r1, *r2;
- NSComparisonResult result;
- NSTimeInterval t1, t2;
-
- sd = [self valueForKey: @"startDate"];
- ed = [self valueForKey: @"endDate"];
- if (sd && ed)
- r1 = [NGCalendarDateRange calendarDateRangeWithStartDate: sd
- endDate: ed];
- else
- r1 = nil;
-
- sd = [_other valueForKey: @"startDate"];
- ed = [_other valueForKey: @"endDate"];
- if (sd && ed)
- r2 = [NGCalendarDateRange calendarDateRangeWithStartDate: sd
- endDate: ed];
- else
- r2 = nil;
-
- if (r1)
- if (r2)
- {
- result = [r1 compare: r2];
- if (result != NSOrderedSame)
- return result;
-
- t1 = [r1 duration];
- t2 = [r2 duration];
- if (t1 == t2)
- return NSOrderedSame;
- if (t1 > t2)
- return NSOrderedDescending;
- }
- else
- return NSOrderedDescending;
- else
- if (!r2)
- return NSOrderedSame;
-
- return NSOrderedAscending;
-}
-
-@end
SchedulerUI_OBJC_FILES = \
SchedulerUIProduct.m \
+ NSArray+Scheduler.m \
\
UIxCalMainView.m \
\
--- /dev/null
+/* NSArray+Scheduler.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#ifndef NSARRAY_SCHEDULER_H
+#define NSARRAY_SCHEDULER_H
+
+#import <Foundation/NSArray.h>
+
+@interface NSArray (SOGoEventComparison)
+
+- (NSComparisonResult) compareEventsAscending: (NSArray *) otherEvent;
+- (NSComparisonResult) compareTasksAscending: (NSArray *) otherTask;
+
+@end
+
+#endif /* NSARRAY_SCHEDULER_H */
--- /dev/null
+/* NSArray+Scheduler.m - this file is part of SOGo
+ *
+ * Copyright (C) 2007 Inverse groupe conseil
+ *
+ * Author: Wolfgang Sourdeau <wsourdeau@inverse.ca>
+ *
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This file 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; see the file COPYING. If not, write to
+ * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+#import <Foundation/NSCalendarDate.h>
+#import <Foundation/NSNull.h>
+#import <Foundation/NSValue.h>
+#import <NGExtensions/NGCalendarDateRange.h>
+
+#import "NSArray+Scheduler.h"
+
+@implementation NSArray (SOGoEventComparison)
+
+- (NSComparisonResult) _compareCompletionWithStatus1: (NSNumber *) status1
+ andStatus2: (NSNumber *) status2
+{
+ NSComparisonResult result;
+ unsigned int ts1, ts2;
+
+ ts1 = [status1 intValue];
+ ts2 = [status2 intValue];
+ if (ts1 == 1 && ts2 != 1)
+ result = NSOrderedDescending;
+ else if (ts1 != 1 && ts2 == 1)
+ result = NSOrderedAscending;
+ else
+ result = NSOrderedSame;
+
+ return result;
+}
+
+- (NSComparisonResult) compareEventsAscending: (NSArray *) otherEvent
+{
+ return [[self objectAtIndex: 4] compare: [otherEvent objectAtIndex: 4]];
+}
+
+- (NSComparisonResult) compareTasksAscending: (NSArray *) otherTask
+{
+ NSComparisonResult result;
+ unsigned int selfTime, otherTime;
+ Class nullClass;
+
+ result = [self _compareCompletionWithStatus1: [self objectAtIndex: 2]
+ andStatus2: [otherTask objectAtIndex: 2]];
+ if (result == NSOrderedSame)
+ {
+ nullClass = [NSNull class];
+ selfTime = [[self objectAtIndex: 4] intValue];
+ otherTime = [[otherTask objectAtIndex: 4] intValue];
+ if (selfTime && !otherTime)
+ result = NSOrderedAscending;
+ else if (!selfTime && otherTime)
+ result = NSOrderedDescending;
+ else
+ {
+ if (selfTime > otherTime)
+ result = NSOrderedDescending;
+ else if (selfTime < otherTime)
+ result = NSOrderedAscending;
+ else
+ result = [[self objectAtIndex: 1]
+ compare: [otherTask objectAtIndex: 1]];
+ }
+ }
+
+ return result;
+}
+
+@end
#import <SoObjects/Appointments/SOGoAppointmentFolder.h>
#import "../SOGoUI/SOGoDateFormatter.h"
+#import "NSArray+Scheduler.h"
#import "UIxCalListingActions.h"
oldEvent = [events nextObject];
}
+ [newEvents sortUsingSelector: @selector (compareEventsAscending:)];
return [self _responseWithData: newEvents];
}
}
task = [tasks nextObject];
}
+ [filteredTasks sortUsingSelector: @selector (compareTasksAscending:)];
return [self _responseWithData: filteredTasks];
}
endOfDay];
}
-- (NSArray *) appointments
-{
- return [self fetchCoreAppointmentsInfos];
-}
+// - (NSArray *) appointments
+// {
+// return [self fetchCoreAppointmentsInfos];
+// }
/* URLs */
bottom: 0px;
left: .2em;
right: .7em;
- padding: 0px; }
+ padding: 0px;
+ overflow: hidden;
+}
DIV#tasksListView H2
{ font-size: 10pt;
{ cursor: default;
margin: .25em;
padding: 0px;
- overflow-x: hidden;
- overflow-y: auto;
border-bottom: 1px solid #fff;
border-right: 1px solid #fff;
border-top: 2px solid #222;
-moz-border-top-colors: #9c9a94 #000 transparent;
-moz-border-left-colors: #9c9a94 #000 transparent;
list-style-type: none;
- list-style-image: none; }
+ list-style-image: none;
+ overflow-y: auto;
+ overflow-x: hidden; }
UL#calendarList
{ clear: both;
position: relative;
width: 100%; }
-TABLE#eventsList td.tbtv_subject_headercell,
+TABLE#eventsList td.headerTitle,
TABLE#eventsList td.headerLocation
{ width: 35%; }
startDate.setTime(data[i][4] * 1000);
row.day = startDate.getDayString();
row.hour = startDate.getHourString();
- Event.observe(row, "click", onEventClick.bindAsEventListener(row));
- Event.observe(row, "dblclick", editDoubleClickedEvent.bindAsEventListener(row));
+ Event.observe(row, "click",
+ onEventClick.bindAsEventListener(row));
+ Event.observe(row, "dblclick",
+ editDoubleClickedEvent.bindAsEventListener(row));
Event.observe(row, "contextmenu",
onEventContextMenu.bindAsEventListener(row));
currentView = http.callbackData["view"];
if (http.callbackData["day"])
currentDay = http.callbackData["day"];
+
var hour = null;
if (http.callbackData["hour"])
hour = http.callbackData["hour"];
}
function onEventClick(event) {
- var target = getTarget(event);
- var node = target.getParentWithTagName("tr");
- var day = node.day;
- var hour = node.hour;
+ var day = this.day;
+ var hour = this.hour;
changeCalendarDisplay( { "day": day, "hour": hour} );
changeDateSelectorDisplay(day);
function calendarEntryCallback(http) {
if (http.readyState == 4) {
- var denied = (http.status != 204)
+ var denied = !isHttpStatus204(http.status);
var entry = $(http.callbackData);
if (denied)
entry.addClassName("denied");
+++ /dev/null
-/* toolbar for mailer application */
-
-table.tb_maintable {
- width: 100%;
- top: 0px; /* this is patched when the linkbar is on */
- height: 40px; /* 48px; */
- z-index: 100;
-}
-td.tb_logocell {
- width: 24px; /* 36px; */
- padding-right: 8px;
-}
-div.tb_consumer { /* consumes the spaces taken by the toolbar */
- height: 52px; /* 58px; */ /* this is patched when the linkbar is on */
- clear: both;
-}
-
-.tb_toolbar {
- height: 22px; /* was 30 */
-}
-.tb_toolbar_group { /* not used currently? */
- height: 22px; /* was 30 */
- padding-right: 16px;
-}
-
-.tb_icon {
- text-align: center;
-}
-.tb_label {
- color: #000000;
- text-align: center;
- padding-left: .5em;
- padding-right: .5em;
-}
-
-.tb_label a:link, .tb_label a:hover {
- color: #000000;
- text-align: center;
-}
-
-.tb_spacer {
- width: 16px;
-}
-
-.tb_icon a {
- width: 24px;
- height: 24px;
- margin: 0px auto;
- display: block;
-}
-
-.tbicon_logo {
- background-image: url(lori_32x32.png);
- width: 32px;
- height: 32px;
-}
-
-/* TODO: hover, doesn't work this way
- as soon as I add ".tbicon_getmail" it stops working
- TODO: we also need to draw a border around the full cell (not too easy))
- => probably we need to move to real icons
-
-.tb_icon a:hover .tbicon_getmail {
- background-image: url(tb-mail-write-off-24x24.png);
-}
-*/
-
-.tbicon_getmail {
- background-image: url(tb-mail-getmail-flat-24x24.png);
-}
-.tbicon_compose {
- background-image: url(tb-mail-write-flat-24x24.png);
-}
-.tbicon_addressbook {
- background-image: url(tb-mail-addressbook-flat-24x24.png);
-}
-.tbicon_anais {
- background-image: url(tbtb_anais.png);
-}
-.tbicon_reply {
- background-image: url(tb-mail-reply-flat-24x24.png);
-}
-.tbicon_replyall {
- background-image: url(tb-mail-replyall-flat-24x24.png);
-}
-.tbicon_forward {
- background-image: url(tb-mail-forward-flat-24x24.png);
-}
-.tbicon_delete {
- background-image: url(tb-mail-delete-flat-24x24.png);
-}
-.tbicon_trash {
- background-image: url(tb-mail-junk-flat-24x24.png);
-}
-.tbicon_junk {
- background-image: url(tb-mail-junk-flat-24x24.png);
-}
-.tbicon_print {
- background-image: url(tb-mail-print-flat-24x24.png);
-}
-.tbicon_stop {
- background-image: url(tb-mail-stop-flat-24x24.png);
-}
-
-.tbicon_send {
- background-image: url(tb-compose-send-flat-24x24.png);
-}
-.tbicon_attach {
- background-image: url(tb-compose-attach-flat-24x24.png);
-}
-.tbicon_save {
- background-image: url(tb-mail-file-flat-24x24.png);
-}
-.tbicon_folderadd {
- background-image: url(tbtb_folderadd.png);
-}
-.tbicon_folderdel {
- background-image: url(tbtb_folderdel.png);
-}