From d037e730c840bf836ea9bcd676a7f09b07f78e6d Mon Sep 17 00:00:00 2001 From: SJ Date: Wed, 19 Sep 2012 15:50:22 +0200 Subject: [PATCH] webui detailed search fixes --- src/config.h | 2 +- webui/controller/search/helper.php | 8 ++++++ webui/view/javascript/piler.js | 6 +++- .../default/templates/common/layout-new.tpl | 12 ++++++-- .../theme/default/templates/search/helper.tpl | 28 +++++++++---------- .../theme/default/templates/search/popup.tpl | 2 +- 6 files changed, 38 insertions(+), 20 deletions(-) diff --git a/src/config.h b/src/config.h index 63dc2efc..02309a2f 100644 --- a/src/config.h +++ b/src/config.h @@ -13,7 +13,7 @@ #define VERSION "0.1.21" -#define BUILD 705 +#define BUILD 706 #define HOSTID "mailarchiver" diff --git a/webui/controller/search/helper.php b/webui/controller/search/helper.php index a82dd0b8..301b450a 100644 --- a/webui/controller/search/helper.php +++ b/webui/controller/search/helper.php @@ -87,6 +87,14 @@ class ControllerSearchHelper extends Controller { private function fixup_post_simple_request() { + if(!isset($this->request->post['from'])) { $this->request->post['from'] = ''; } + if(!isset($this->request->post['to'])) { $this->request->post['to'] = ''; } + if(!isset($this->request->post['subject'])) { $this->request->post['subject'] = ''; } + if(!isset($this->request->post['body'])) { $this->request->post['body'] = ''; } + if(!isset($this->request->post['tag'])) { $this->request->post['tag'] = ''; } + if(!isset($this->request->post['note'])) { $this->request->post['note'] = ''; } + if(!isset($this->request->post['any'])) { $this->request->post['any'] = ''; } + if(!isset($this->request->post['attachment_type'])) { $this->request->post['attachment_type'] = ''; } if(!isset($this->request->post['date1'])) { $this->request->post['date1'] = ''; } if(!isset($this->request->post['date2'])) { $this->request->post['date2'] = ''; } } diff --git a/webui/view/javascript/piler.js b/webui/view/javascript/piler.js index 41778c73..7fafa622 100644 --- a/webui/view/javascript/piler.js +++ b/webui/view/javascript/piler.js @@ -212,7 +212,8 @@ function add_message_reference_to_form(s) { } -function assemble_search_term(n, prefix) { +function assemble_search_term(n) { + var prefix = ''; var data = ''; var attachment_type = ''; var e; @@ -220,6 +221,9 @@ function assemble_search_term(n, prefix) { var extra_folders = ''; var childNodeArray = new Array(); + e = document.getElementById('prefix'); + if(e && e.value) { prefix = e.value; } + e = document.getElementById(prefix + 'searchtype'); if(e && e.value) { data = data + "searchtype=" + e.value; } diff --git a/webui/view/theme/default/templates/common/layout-new.tpl b/webui/view/theme/default/templates/common/layout-new.tpl index 89cafc6b..d309d5aa 100644 --- a/webui/view/theme/default/templates/common/layout-new.tpl +++ b/webui/view/theme/default/templates/common/layout-new.tpl @@ -64,7 +64,12 @@ }); shortcut.add("Enter", function() { - var a=document.getElementById('ref'); if(a) a.value=''; load_search_results('', assemble_search_term(count, ''), 0); + var a; + a = document.getElementById('ref'); + if(a) a.value=''; + a = document.getElementById('prefix'); + if(a) a.value=''; + load_search_results('', assemble_search_term(count), 0); },{ 'type':'keydown', 'propagate':true, @@ -98,6 +103,7 @@ + : @@ -107,9 +113,9 @@
- + - + diff --git a/webui/view/theme/default/templates/search/helper.tpl b/webui/view/theme/default/templates/search/helper.tpl index 4b72ce3f..76460690 100644 --- a/webui/view/theme/default/templates/search/helper.tpl +++ b/webui/view/theme/default/templates/search/helper.tpl @@ -9,23 +9,23 @@
aaa
- - + +
- - + +
- - + +
- - + +
 
 
@@ -47,7 +47,7 @@
.
">
-
title="" onmouseover="javascript: current_message_id = ; return false;" onclick="script:highlight_message_by_position(); current_message_id = ; return false;"> [+]
+
title="" onmouseover="javascript: current_message_id = ; return false;" onclick="script:highlight_message_by_position(); current_message_id = ; return false;"> [+]
0) { ?> 
@@ -72,8 +72,8 @@ diff --git a/webui/view/theme/default/templates/search/popup.tpl b/webui/view/theme/default/templates/search/popup.tpl index 03a25c7f..86ae53f1 100644 --- a/webui/view/theme/default/templates/search/popup.tpl +++ b/webui/view/theme/default/templates/search/popup.tpl @@ -58,7 +58,7 @@
- +