From 4d5d28fa0f2ba4a0692991d8f93017b508c06018 Mon Sep 17 00:00:00 2001 From: helge Date: Sat, 12 Feb 2005 17:36:03 +0000 Subject: [PATCH] implemented OGo bug #1209 (IMAP4 subject/sender searching) git-svn-id: http://svn.opengroupware.org/SOGo/trunk@547 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/SoObjects/Mailer/SOGoMailManager.m | 3 +++ SOGo/UI/Mailer/ChangeLog | 9 +++++++ SOGo/UI/Mailer/UIxMailListView.m | 35 +++++++++++++++++++++---- SOGo/UI/Mailer/UIxMailListView.wox | 8 +++--- SOGo/UI/Mailer/Version | 3 ++- SOGo/UI/Mailer/mailer.js | 12 +++++++-- SOGo/UI/Mailer/product.plist | 4 +++ 7 files changed, 63 insertions(+), 11 deletions(-) diff --git a/SOGo/SoObjects/Mailer/SOGoMailManager.m b/SOGo/SoObjects/Mailer/SOGoMailManager.m index eb27b402..fd6ba062 100644 --- a/SOGo/SoObjects/Mailer/SOGoMailManager.m +++ b/SOGo/SoObjects/Mailer/SOGoMailManager.m @@ -29,6 +29,9 @@ self->isReadOnly = [[dict objectForKey:@"access"] isEqualToString:@"READ-WRITE"] ? NoNumber : YesNumber; + + TODO: to implement copy, use "uid copy" instead of "copy" as used by + NGImap4Client. */ @implementation SOGoMailManager diff --git a/SOGo/UI/Mailer/ChangeLog b/SOGo/UI/Mailer/ChangeLog index da3892ac..b9047079 100644 --- a/SOGo/UI/Mailer/ChangeLog +++ b/SOGo/UI/Mailer/ChangeLog @@ -1,3 +1,12 @@ +2005-02-12 Helge Hess + + * v0.9.99 + + * product.plist: also map index method of mail folder to + UIxMailListView + + * UIxMailListView.m: added subject/sender searching (bug OGo #1209) + 2005-02-10 Helge Hess * UIxMailPartLinkViewer.wox, UIxMailPartMessageViewer.wox: added diff --git a/SOGo/UI/Mailer/UIxMailListView.m b/SOGo/UI/Mailer/UIxMailListView.m index eac0fdc9..c7109a7c 100644 --- a/SOGo/UI/Mailer/UIxMailListView.m +++ b/SOGo/UI/Mailer/UIxMailListView.m @@ -34,6 +34,7 @@ NSArray *messages; unsigned firstMessageNumber; id message; + NSString *searchText; } - (NSString *)defaultSortKey; @@ -53,6 +54,7 @@ static int attachmentFlagSize = 8096; - (void)dealloc { + [self->searchText release]; [self->sortedUIDs release]; [self->messages release]; [self->message release]; @@ -77,6 +79,18 @@ static int attachmentFlagSize = 8096; return self->message; } +- (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; +} + - (BOOL)showToAddress { NSString *ftype; @@ -148,8 +162,22 @@ static int attachmentFlagSize = 8096; return keys; } -- (id)qualifier { - return nil; +- (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 { @@ -408,9 +436,6 @@ static int attachmentFlagSize = 8096; /* actions */ - (id)defaultAction { -#if 0 - [self logWithFormat:@"default action ..."]; -#endif self->firstMessageNumber = [[[[self context] request] formValueForKey:@"idx"] intValue]; return self; diff --git a/SOGo/UI/Mailer/UIxMailListView.wox b/SOGo/UI/Mailer/UIxMailListView.wox index 2255b4f9..14bf9dcc 100644 --- a/SOGo/UI/Mailer/UIxMailListView.wox +++ b/SOGo/UI/Mailer/UIxMailListView.wox @@ -17,10 +17,12 @@ +--> - Subject or Sender contains: - - + : + + diff --git a/SOGo/UI/Mailer/Version b/SOGo/UI/Mailer/Version index d1a68c8c..67953ae1 100644 --- a/SOGo/UI/Mailer/Version +++ b/SOGo/UI/Mailer/Version @@ -1,7 +1,8 @@ # version file -SUBMINOR_VERSION:=98 +SUBMINOR_VERSION:=99 +# 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 diff --git a/SOGo/UI/Mailer/mailer.js b/SOGo/UI/Mailer/mailer.js index a6e154bf..2163872f 100644 --- a/SOGo/UI/Mailer/mailer.js +++ b/SOGo/UI/Mailer/mailer.js @@ -6,15 +6,15 @@ div_$msgid readdiv_$msgid unreaddiv_$msgid -*/ -/* Window Properties: width, height bool: resizable, scrollbars, toolbar, location, directories, status, menubar, copyhistory */ +/* mail list */ + function clickedUid(sender, msguid) { var urlstr; @@ -41,6 +41,14 @@ function lowlightUid(sender, msguid) { return true; } +function clearSearch(sender) { + var searchField = window.document.getElementById("searchtext"); + if (searchField) searchField.value=""; + return true; +} + +/* compose support */ + function clickedCompose(sender) { var urlstr; diff --git a/SOGo/UI/Mailer/product.plist b/SOGo/UI/Mailer/product.plist index 277a0607..e2c6c826 100644 --- a/SOGo/UI/Mailer/product.plist +++ b/SOGo/UI/Mailer/product.plist @@ -129,6 +129,10 @@ protectedBy = "View"; pageName = "UIxMailListView"; }; + index = { + protectedBy = "View"; + pageName = "UIxMailListView"; + }; GET = { /* hack to make it work as the default method */ protectedBy = "View"; pageName = "UIxMailListView"; -- 2.39.5