2004-08-27 Helge Hess <helge.hess@skyrix.com>
+ * started UIxSortButton (v0.9.20)
+
* v0.9.19
* UIxPageFrame.wox: navigation below the line, app selection above
UIxPageFrame.m \
UIxPrintPageFrame.m \
UIxWinClose.m \
+ UIxSortButton.m \
UIxAppNavView.m \
\
UIxElemBuilder.m \
UIxPageFrame.wox \
UIxPrintPageFrame.wox \
UIxWinClose.wox \
+ UIxSortButton.wox \
UIxAppNavView.wox \
\
uix.css \
images/tab_selected.gif \
images/tab_.gif \
images/corner_right.gif \
- images/closewindow.gif
+ images/closewindow.gif \
+ images/upward_sorted.gif\
+ images/downward_sorted.gif \
+ images/non_sorted.gif \
# make
[super dealloc];
}
+/* accessors */
+
- (void)setElement:(id)_element {
ASSIGN(self->element, _element);
}
return self->lastElement;
}
+/* navigation */
+
- (NSArray *)navPathElements {
NSArray *traversalObjects;
NSMutableArray *navPathComponents;
--- /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: UIxSortButton.m 59 2004-06-22 13:40:19Z znek $
+
+#include <NGObjWeb/NGObjWeb.h>
+
+@interface UIxSortButton : WOComponent
+{
+}
+
+@end
+
+
+@implementation UIxSortButton
+@end
--- /dev/null
+<?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"
+>
+ <!--
+ The resource cannot be found, for unknown reasons ...
+ -->
+ <img filename="non_sorted.gif" border="0" />
+</span>
\ No newline at end of file
tab_.gif,
corner_right.gif,
closewindow.gif,
- OGoLogo.gif
+ OGoLogo.gif,
+ upward_sorted.gif,
+ downward_sorted.gif,
+ non_sorted.gif
);
factories = {
2004-08-27 Helge Hess <helge.hess@skyrix.com>
+ * UIxContactsListView: added simple sorting (v0.9.5)
+
* first working version of contacts UI (v0.9.4)
* removed GET from product.plist, the SoObject directly implements GET
@end
+#include <Contacts/SOGoContactFolder.h>
#include "common.h"
@implementation UIxContactsListView
return self->contact;
}
+- (NSString *)defaultSortKey {
+ return @"sn";
+}
+- (NSString *)sortKey {
+ NSString *s;
+
+ s = [[[self context] request] formValueForKey:@"sort"];
+ return [s length] > 0 ? s : [self defaultSortKey];
+}
+
+static int sortDicts(id left, id right, void *ctx) {
+ id v1, v2;
+
+ v1 = [left valueForKey:ctx];
+ v2 = [right valueForKey:ctx];
+ return [v1 caseInsensitiveCompare:v2];
+}
+
+- (NSArray *)contactInfos {
+ NSString *sort;
+ NSArray *records;
+
+ // TODO: should be done in the backend, but for Agenor AB its OK here
+ sort = [self sortKey];
+
+ records = [[self clientObject] fetchCoreInfos];
+ if ([sort length] > 0)
+ records = [records sortedArrayUsingFunction:sortDicts context:sort];
+ return records;
+}
+
/* notifications */
- (void)sleep {
<table border="0" width="100%" class="contacttableview">
<tr>
<!-- localize -->
- <th>Lastname</th>
- <th>Firstname</th>
- <th>Email</th>
- <th>Phone</th>
- <th>Location</th>
+ <th>
+ <var:if condition="sortKey" const:value="sn"
+ const:negate="YES">
+ <a href="?sort=sn">Lastname</a>
+ </var:if>
+ <var:if condition="sortKey" const:value="sn">
+ <i>Lastname</i>
+ </var:if>
+ </th>
+ <th>
+ <var:if condition="sortKey" const:value="givenname"
+ const:negate="YES">
+ <a href="?sort=givenname">Firstname</a>
+ </var:if>
+ <var:if condition="sortKey" const:value="givenname">
+ <i>Firstname</i>
+ </var:if>
+ </th>
+ <th>
+ <var:if condition="sortKey" const:value="mail"
+ const:negate="YES">
+ <a href="?sort=mail">EMail</a>
+ </var:if>
+ <var:if condition="sortKey" const:value="mail">
+ <i>Email</i>
+ </var:if>
+ </th>
+ <th>
+ Phone
+ </th>
+ <th>
+ Location
+ </th>
</tr>
- <var:foreach list="clientObject.fetchCoreInfos"
- item="contact">
+ <var:foreach list="contactInfos" item="contact">
<tr>
<td>
<a var:href="contact.cName"
# $Id$
-SUBMINOR_VERSION:=4
+SUBMINOR_VERSION:=5