]> err.no Git - scalable-opengroupware.org/commitdiff
git-svn-id: http://svn.opengroupware.org/SOGo/inverse/trunk@1084 d1b88da0-ebda-0310...
authorwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 13 Jun 2007 19:34:50 +0000 (19:34 +0000)
committerwolfgang <wolfgang@d1b88da0-ebda-0310-925b-ed51d893ca5b>
Wed, 13 Jun 2007 19:34:50 +0000 (19:34 +0000)
13 files changed:
ChangeLog
SoObjects/Appointments/SOGoAppointmentFolder.m
SoObjects/SOGo/GNUmakefile
SoObjects/SOGo/NSObject+AptComparison.h [deleted file]
SoObjects/SOGo/NSObject+AptComparison.m [deleted file]
UI/Scheduler/GNUmakefile
UI/Scheduler/NSArray+Scheduler.h [new file with mode: 0644]
UI/Scheduler/NSArray+Scheduler.m [new file with mode: 0644]
UI/Scheduler/UIxCalListingActions.m
UI/Scheduler/UIxCalWeekView.m
UI/WebServerResources/SchedulerUI.css
UI/WebServerResources/SchedulerUI.js
UI/WebServerResources/mailer-toolbar.css [deleted file]

index 189cd503a33dff930d04128f7e8aa4b0921b4289..022ce2c83a77522b4513a068feb7461a6a87dd16 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+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
index afeee3057775407ef8d892a6bb8859f081ad91de..66d5c14cc2f258b0f122e8314b73895149984b8f 100644 (file)
@@ -869,12 +869,6 @@ static NSNumber   *sharedYes = nil;
       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]];
 
index ca032f9e88cb86aa798f241961141c488af20eed..03916b358e24f4a7b1233a6e46eddef8e016a1ae 100644 (file)
@@ -32,7 +32,6 @@ libSOGo_HEADER_FILES = \
        LDAPSource.h                    \
        SOGoPermissions.h               \
        SOGoLRUCache.h                  \
-       NSObject+AptComparison.h        \
        WOContext+Agenor.h              \
        SOGoDAVRendererTypes.h          \
        NSArray+Utilities.h             \
@@ -61,7 +60,6 @@ libSOGo_OBJC_FILES = \
        SOGoLRUCache.m                  \
        LDAPUserManager.m               \
        LDAPSource.m                    \
-       NSObject+AptComparison.m        \
        WOContext+Agenor.m              \
        SOGoDAVRendererTypes.m          \
        AgenorUserDefaults.m            \
diff --git a/SoObjects/SOGo/NSObject+AptComparison.h b/SoObjects/SOGo/NSObject+AptComparison.h
deleted file mode 100644 (file)
index ae50afd..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
-  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_ */
diff --git a/SoObjects/SOGo/NSObject+AptComparison.m b/SoObjects/SOGo/NSObject+AptComparison.m
deleted file mode 100644 (file)
index d3b0eb2..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-  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
index 455d1bd11233e8d432a7bc6716c7e7fb67196524..b8f79463a7ff574dd79d2d40065d87217397aa20 100644 (file)
@@ -10,6 +10,7 @@ SchedulerUI_LANGUAGES = English French German
 
 SchedulerUI_OBJC_FILES =               \
        SchedulerUIProduct.m            \
+       NSArray+Scheduler.m             \
                                        \
        UIxCalMainView.m                \
                                        \
diff --git a/UI/Scheduler/NSArray+Scheduler.h b/UI/Scheduler/NSArray+Scheduler.h
new file mode 100644 (file)
index 0000000..ac8e8b9
--- /dev/null
@@ -0,0 +1,35 @@
+/* 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 */
diff --git a/UI/Scheduler/NSArray+Scheduler.m b/UI/Scheduler/NSArray+Scheduler.m
new file mode 100644 (file)
index 0000000..d6d45df
--- /dev/null
@@ -0,0 +1,87 @@
+/* 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
index d3aa3cac67daa9e87052a3500e710ef792aad5d5..d946a13daf18ee8d37489d29bffb22baa4b1fb86 100644 (file)
@@ -39,6 +39,7 @@
 #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];
 }
index ab520323a3b4fd3719e765e446c4e863fa733161..ff06cc7b9f0b8b1c97103f40ad1998820dd66d86 100644 (file)
                             endOfDay];
 }
 
-- (NSArray *) appointments
-{
-  return [self fetchCoreAppointmentsInfos];
-}
+// - (NSArray *) appointments
+// {
+//   return [self fetchCoreAppointmentsInfos];
+// }
 
 /* URLs */
 
index b3b26fc4c80dabc79a8f671cbbc461c91c035071..a8f87456eacba218d5da42a684bccff0bcfb5c75 100644 (file)
@@ -20,7 +20,9 @@ DIV#tasksListView
   bottom: 0px;
   left: .2em;
   right: .7em;
-  padding: 0px; }
+  padding: 0px;
+  overflow: hidden;
+}
 
 DIV#tasksListView H2
 { font-size: 10pt;
@@ -55,8 +57,6 @@ UL#tasksList, UL#calendarList
 { 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;
@@ -65,7 +65,9 @@ UL#tasksList, UL#calendarList
   -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;
@@ -270,7 +272,7 @@ TABLE#eventsList
   position: relative;
   width: 100%; }
 
-TABLE#eventsList td.tbtv_subject_headercell,
+TABLE#eventsList td.headerTitle,
 TABLE#eventsList td.headerLocation
 { width: 35%; }
 
index d5993316f376ffa6d7dbc5b09ad0c0ff60eb1a49..d5e22f6bba106f08fe5de9c36bc5f1cce72719d4 100644 (file)
@@ -319,8 +319,10 @@ function eventsListCallback(http) {
       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));
 
@@ -760,6 +762,7 @@ function calendarDisplayCallback(http) {
       currentView = http.callbackData["view"];
     if (http.callbackData["day"])
       currentDay = http.callbackData["day"];
+
     var hour = null;
     if (http.callbackData["hour"])
       hour = http.callbackData["hour"];
@@ -942,10 +945,8 @@ function onListFilterChange() {
 }
 
 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);
@@ -1212,7 +1213,7 @@ function calendarStatusCallback(http) {
 
 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");
diff --git a/UI/WebServerResources/mailer-toolbar.css b/UI/WebServerResources/mailer-toolbar.css
deleted file mode 100644 (file)
index 005a21a..0000000
+++ /dev/null
@@ -1,119 +0,0 @@
-/* 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);   
-}