summaryrefslogtreecommitdiff
path: root/program/js/app.js
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-06-01 13:44:51 +0000
committeralecpl <alec@alec.pl>2011-06-01 13:44:51 +0000
commit3cacf941fa30e8c02f3f7aebcc8747036d0d8d20 (patch)
tree3d873bb15f9454b28c3c4a8ba3216421ededdfd4 /program/js/app.js
parent2912de6f9bea6c0491a7bc4321e66637da0a6746 (diff)
- Add popup with basic fields selection for addressbook search
Diffstat (limited to 'program/js/app.js')
-rw-r--r--program/js/app.js26
1 files changed, 14 insertions, 12 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 32d7a6332..db79772a1 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3332,31 +3332,33 @@ function rcube_webmail()
this.qsearch = function(value)
{
if (value != '') {
- var addurl = '';
+ var n, addurl = '', mods_arr = [],
+ mods = this.env.search_mods,
+ mbox = this.env.mailbox,
+ lock = this.set_busy(true, 'searching');
+
if (this.message_list) {
this.clear_message_list();
- if (this.env.search_mods) {
- var mods = this.env.search_mods[this.env.mailbox] ? this.env.search_mods[this.env.mailbox] : this.env.search_mods['*'];
- if (mods) {
- var head_arr = [];
- for (var n in mods)
- head_arr.push(n);
- addurl += '&_headers='+head_arr.join(',');
- }
- }
+ if (mods)
+ mods = mods[mbox] ? mods[mbox] : mods['*'];
} else if (this.contact_list) {
this.contact_list.clear(true);
this.show_contentframe(false);
}
+ if (mods) {
+ for (n in mods)
+ mods_arr.push(n);
+ addurl += '&_headers='+mods_arr.join(',');
+ }
+
if (this.gui_objects.search_filter)
addurl += '&_filter=' + this.gui_objects.search_filter.value;
// reset vars
this.env.current_page = 1;
- var lock = this.set_busy(true, 'searching');
this.http_request('search', '_q='+urlencode(value)
- + (this.env.mailbox ? '&_mbox='+urlencode(this.env.mailbox) : '')
+ + (mbox ? '&_mbox='+urlencode(mbox) : '')
+ (this.env.source ? '&_source='+urlencode(this.env.source) : '')
+ (this.env.group ? '&_gid='+urlencode(this.env.group) : '')
+ (addurl ? addurl : ''), lock);