2005-02-12 Helge Hess <helge.hess@opengroupware.org>
+ * v0.9.100
+
+ * added support for filter popup (OGo bug #1210)
+
+ * UIxMailListView: moved filter selection to an own component
+
* v0.9.99
* product.plist: also map index method of mail folder to
UIxMailListView
- * UIxMailListView.m: added subject/sender searching (bug OGo #1209)
+ * UIxMailListView.m: added subject/sender searching (OGo bug #1209)
2005-02-10 Helge Hess <helge.hess@opengroupware.org>
UIxMailView.m \
UIxMailSortableTableHeader.m \
UIxMailMoveToPopUp.m \
+ UIxMailFilterPanel.m \
\
UIxMailEditor.m \
UIxMailEditorAttach.m \
UIxMailView.wox \
UIxMailSortableTableHeader.wox \
UIxMailMoveToPopUp.wox \
+ UIxMailFilterPanel.wox \
\
UIxMailEditor.wox \
UIxMailEditorAttach.wox \
--- /dev/null
+/*
+ Copyright (C) 2000-2005 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.
+ */
+
+#include <NGObjWeb/WOComponent.h>
+
+@interface UIxMailFilterPanel : WOComponent
+{
+ NSString *searchText;
+}
+
+@end
+
+#include <SOGoUI/UIxComponent.h>
+#include "common.h"
+
+@implementation UIxMailFilterPanel
+
+static NSArray *filters = nil;
+static NSDictionary *filterToQualifier = nil;
+
++ (void)initialize {
+ // TODO: also available: answered, draft [custom: NotJunk and Junk]
+ // Note: we currently cannot use: "flags != 'deleted'"
+ static NSString *quals[] = {
+ @"all", nil,
+ @"read", @"flags = 'seen' AND NOT (flags = 'deleted')",
+ @"unread", @"flags = 'unseen' AND NOT (flags = 'deleted')",
+ @"deleted", @"flags = 'deleted'",
+ @"flagged", @"flags = 'flagged'",
+ nil, nil
+ };
+ NSMutableDictionary *md;
+ NSMutableArray *ma;
+ unsigned i;
+
+ md = [[NSMutableDictionary alloc] initWithCapacity:8];
+ ma = [[NSMutableArray alloc] initWithCapacity:4];
+
+ for (i = 0; quals[i] != nil; i += 2) {
+ [ma addObject:quals[i]];
+ if (quals[i + 1] != nil) {
+ [md setObject:[EOQualifier qualifierWithQualifierFormat:quals[i + 1]]
+ forKey:quals[i]];
+ }
+ }
+
+ filterToQualifier = [md copy];
+ filters = [ma copy];
+ [md release]; md = nil;
+ [ma release]; ma = nil;
+}
+
+- (void)dealloc {
+ [self->searchText release];
+ [super dealloc];
+}
+
+/* accessors */
+
+- (void)setSearchText:(NSString *)_txt {
+ ASSIGNCOPY(self->searchText, _txt);
+}
+- (NSString *)searchText {
+ if (self->searchText == nil) {
+ // TODO: kinda hack
+ self->searchText =
+ [[[[self context] request] formValueForKey:@"searchtext"] copy];
+ }
+ return self->searchText;
+}
+
+/* filters */
+
+- (NSArray *)filters {
+ return filters;
+}
+
+/* qualifiers */
+
+- (EOQualifier *)searchTextQualifier {
+ EOQualifier *q;
+ NSString *s;
+
+ s = [self searchText];
+ if ([s length] == 0)
+ return nil;
+
+ q = [EOQualifier qualifierWithQualifierFormat:
+ @"(subject doesContain: %@) OR "
+ @"(from doesContain: %@)",
+ s, s];
+ return q;
+}
+
+- (NSString *)filterLabel {
+#if 1
+ return [[[self context] page] labelForKey:[self valueForKey:@"filter"]];
+#else
+ return [self valueForKey:@"filter"];
+#endif
+}
+
+- (NSString *)selectedFilter {
+ return [[[self context] request] formValueForKey:@"filterpopup"];
+}
+
+- (EOQualifier *)filterQualifier {
+ NSString *selectedFilter;
+
+ selectedFilter = [self selectedFilter];
+
+ return [selectedFilter length] > 0
+ ? [filterToQualifier objectForKey:selectedFilter] : nil;
+}
+
+- (EOQualifier *)qualifier {
+ EOQualifier *sq, *fq;
+ NSArray *qa;
+
+ sq = [self searchTextQualifier];
+ fq = [self filterQualifier];
+
+ if (fq == nil) return sq;
+ if (sq == nil) return fq;
+
+ qa = [NSArray arrayWithObjects:fq, sq, nil];
+ return [[[EOAndQualifier alloc] initWithQualifierArray:qa] autorelease];
+}
+
+@end /* UIxMailFilterPanel */
--- /dev/null
+<?xml version='1.0' standalone='yes'?>
+<div
+ xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:var="http://www.skyrix.com/od/binding"
+ xmlns:const="http://www.skyrix.com/od/constant"
+ xmlns:uix="OGo:uix"
+ xmlns:rsrc="OGo:url"
+ xmlns:label="OGo:label"
+ class="titlediv" style="white-space: nowrap;"
+>
+ <var:string label:value="View" />:
+ <var:popup list="filters"
+ item="filter" string="filterLabel" value="filter"
+ selection="selectedFilter"
+ const:name="filterpopup"
+ const:onchange="document.pageform.submit()" />
+
+ <var:string label:value="Subject or Sender contains" />:
+ <input name="searchtext" type="text" var:value="searchText" />
+<!--
+ <input type="button" onclick="clearSearch(this)" label:value="Clear" />
+-->
+</div>
object.
*/
+@class EOQualifier;
+
@interface UIxMailListView : UIxComponent
{
- NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
- NSArray *messages;
- unsigned firstMessageNumber;
- id message;
- NSString *searchText;
+ NSArray *sortedUIDs; /* we always need to retrieve all anyway! */
+ NSArray *messages;
+ unsigned firstMessageNumber;
+ id message;
+ EOQualifier *qualifier;
}
- (NSString *)defaultSortKey;
static int attachmentFlagSize = 8096;
- (void)dealloc {
- [self->searchText release];
+ [self->qualifier release];
[self->sortedUIDs release];
[self->messages release];
[self->message release];
/* notifications */
- (void)sleep {
+ [self->qualifier release]; self->qualifier = nil;
[self->sortedUIDs release]; self->sortedUIDs = nil;
- [self->messages release]; self->messages = nil;
- [self->message release]; self->message = nil;
+ [self->messages release]; self->messages = nil;
+ [self->message release]; self->message = nil;
[super sleep];
}
return self->message;
}
-- (void)setSearchText:(NSString *)_txt {
- ASSIGNCOPY(self->searchText, _txt);
+- (void)setQualifier:(EOQualifier *)_msg {
+ ASSIGN(self->qualifier, _msg);
}
-- (NSString *)searchText {
- if (self->searchText == nil) {
- // TODO: kinda hack
- self->searchText =
- [[[[self context] request] formValueForKey:@"searchtext"] copy];
- }
- return self->searchText;
+- (EOQualifier *)qualifier {
+ return self->qualifier;
}
- (BOOL)showToAddress {
return keys;
}
-- (EOQualifier *)searchTextQualifier {
- EOQualifier *q;
- NSString *s;
-
- s = [self searchText];
- if ([s length] == 0)
- return nil;
-
- q = [EOQualifier qualifierWithQualifierFormat:
- @"(subject doesContain: %@) OR "
- @"(from doesContain: %@)",
- s, s];
- return q;
-}
-- (EOQualifier *)qualifier {
- return [self searchTextQualifier];
-}
-
- (NSString *)defaultSortKey {
return @"DATE";
}
className="UIxMailMainFrame"
title="panelTitle"
>
- <div class="titlediv" style="white-space: nowrap;">
-<!-- TODO: enable once implemented: #1209, #1210
- <a rsrc:href="tbird_073_mailwelcome.png"
- ><var:string label:value="View" />:</a>,
- <select name="viewfilter"> => var:popup?
- <option value="all" ><var:string label:value="All" /></option>
- <option value="unread"><var:string label:value="Unread" /></option>
- </select>
--->
-
- <var:string label:value="Subject or Sender contains" />:
- <input name="searchtext" type="text" var:value="searchText" />
-<!--
- <input type="button" onclick="clearSearch(this)" label:value="Clear" />
--->
- </div>
+ <var:component className="UIxMailFilterPanel" qualifier="qualifier" />
<div class="embedwhite_out">
<div class="embedwhite_in">
/*
- Copyright (C) 2000-2004 SKYRIX Software AG
+ Copyright (C) 2000-2005 SKYRIX Software AG
This file is part of OpenGroupware.org.
Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA.
*/
-// $Id$
#include <NGObjWeb/WOComponent.h>
[super dealloc];
}
+/* accessors */
+
- (void)setIdentifier:(NSString *)_identifier {
ASSIGN(self->identifier, _identifier);
}
# version file
-SUBMINOR_VERSION:=99
+SUBMINOR_VERSION:=100
-# v0.9.99 requires libNGMime v4.5.212
-# v0.9.97 requires SoObjects/Mailer v0.9.71
-# v0.9.97 requires libNGExtensions v4.5.142
-# v0.9.94 requires SoObjects/Mailer v0.9.69
-# v0.9.94 requires libNGMime v4.5.210
-# v0.9.91 requires SoObjects/Mailer v0.9.68
-# v0.9.89 requires SoObjects/Mailer v0.9.67
-# v0.9.87 requires SoObjects/Mailer v0.9.65
-# v0.9.86 requires SoObjects/Mailer v0.9.64
-# v0.9.85 requires SoObjects/Mailer v0.9.63
-# v0.9.84 requires libNGMime v4.5.209
-# v0.9.81 requires SoObjects/Sieve v0.9.5
-# v0.9.80 requires SoObjects/Mailer v0.9.59
-# v0.9.78 requires SoObjects/Mailer v0.9.58
-# v0.9.77 requires SoObjects/Mailer v0.9.57
-# v0.9.74 requires SoObjects/Mailer v0.9.56
-# v0.9.70 requires libNGExtensions v4.5.136
-# v0.9.69 requires libNGMime v4.5.203
-# v0.9.50 requires libNGMime v4.3.190
-# v0.9.43 requires libNGObjWeb v4.3.73
-# v0.9.42 requires libNGObjWeb v4.3.72
+# v0.9.100 requires libNGMime v4.5.213
+# v0.9.99 requires libNGMime v4.5.212
+# v0.9.97 requires SoObjects/Mailer v0.9.71
+# v0.9.97 requires libNGExtensions v4.5.142
+# v0.9.94 requires SoObjects/Mailer v0.9.69
+# v0.9.94 requires libNGMime v4.5.210
+# v0.9.91 requires SoObjects/Mailer v0.9.68
+# v0.9.89 requires SoObjects/Mailer v0.9.67
+# v0.9.87 requires SoObjects/Mailer v0.9.65
+# v0.9.86 requires SoObjects/Mailer v0.9.64
+# v0.9.85 requires SoObjects/Mailer v0.9.63
+# v0.9.84 requires libNGMime v4.5.209
+# v0.9.81 requires SoObjects/Sieve v0.9.5
+# v0.9.80 requires SoObjects/Mailer v0.9.59
+# v0.9.78 requires SoObjects/Mailer v0.9.58
+# v0.9.77 requires SoObjects/Mailer v0.9.57
+# v0.9.74 requires SoObjects/Mailer v0.9.56
+# v0.9.70 requires libNGExtensions v4.5.136
+# v0.9.69 requires libNGMime v4.5.203
+# v0.9.50 requires libNGMime v4.3.190
+# v0.9.43 requires libNGObjWeb v4.3.73
+# v0.9.42 requires libNGObjWeb v4.3.72