Fix bug where some messages in multi-folder search couldn't be printed/downloaded (#1490426)

Conflicts:

	program/js/app.js
pull/282/merge
Aleksander Machniak 10 years ago
parent 383749eeff
commit 895efa1d42

@ -6,7 +6,7 @@ CHANGELOG Roundcube Webmail
- Fix SQL error on logout when using session_storage=php (#1490421) - Fix SQL error on logout when using session_storage=php (#1490421)
- Update to jQuery 2.1.4 (#1490406) - Update to jQuery 2.1.4 (#1490406)
- Fix Compose action in addressbook for results from multiple addressbooks (#1490413) - Fix Compose action in addressbook for results from multiple addressbooks (#1490413)
- Fix bug where some messages in multi-folder search couldn't be opened (#1490426) - Fix bug where some messages in multi-folder search couldn't be viewed/printed/downloaded (#1490426)
- Fix unintentional messages list page change on page switch in compose addressbook (#1490427) - Fix unintentional messages list page change on page switch in compose addressbook (#1490427)
- Fix race-condition in saving user preferences and loading plugin config (#1490431) - Fix race-condition in saving user preferences and loading plugin config (#1490431)
- Fix so plain text signature field uses monospace font (#1490435) - Fix so plain text signature field uses monospace font (#1490435)

@ -54,7 +54,7 @@ function rcmail_zipdownload(mode)
// default .eml download of single message // default .eml download of single message
if (mode == 'eml') { if (mode == 'eml') {
var uid = rcmail.get_single_uid(); var uid = rcmail.get_single_uid();
rcmail.goto_url('viewsource', {_uid: uid, _mbox: rcmail.get_message_mailbox(uid), _save: 1}); rcmail.goto_url('viewsource', rcmail.params_from_uid(uid, {_save: 1}));
return; return;
} }

@ -762,7 +762,7 @@ function rcube_webmail()
case 'open': case 'open':
if (uid = this.get_single_uid()) { if (uid = this.get_single_uid()) {
obj.href = this.url('show', {_mbox: this.get_message_mailbox(uid), _uid: uid}); obj.href = this.url('show', this.params_from_uid(uid));
return true; return true;
} }
break; break;
@ -1188,8 +1188,8 @@ function rcube_webmail()
this.gui_objects.messagepartframe.contentWindow.print(); this.gui_objects.messagepartframe.contentWindow.print();
} }
else if (uid = this.get_single_uid()) { else if (uid = this.get_single_uid()) {
url = '&_action=print&_uid='+uid+'&_mbox='+urlencode(this.get_message_mailbox(uid))+(this.env.safemode ? '&_safe=1' : ''); url = this.url('print', this.params_from_uid(uid, {_safe: this.env.safemode ? 1 : 0}));
if (this.open_window(this.env.comm_path + url, true, true)) { if (this.open_window(url, true, true)) {
if (this.env.action != 'show') if (this.env.action != 'show')
this.mark_message('read', uid); this.mark_message('read', uid);
} }
@ -1198,7 +1198,7 @@ function rcube_webmail()
case 'viewsource': case 'viewsource':
if (uid = this.get_single_uid()) if (uid = this.get_single_uid())
this.open_window(this.env.comm_path+'&_action=viewsource&_uid='+uid+'&_mbox='+urlencode(this.env.mailbox), true, true); this.open_window(this.url('viewsource', this.params_from_uid(uid)), true, true);
break; break;
case 'download': case 'download':
@ -1206,7 +1206,7 @@ function rcube_webmail()
location.href = location.href.replace(/_frame=/, '_download='); location.href = location.href.replace(/_frame=/, '_download=');
} }
else if (uid = this.get_single_uid()) { else if (uid = this.get_single_uid()) {
this.goto_url('viewsource', { _uid: uid, _mbox: this.get_message_mailbox(uid), _save: 1 }); this.goto_url('viewsource', this.params_from_uid(uid, {_save: 1}));
} }
break; break;
@ -2233,12 +2233,7 @@ function rcube_webmail()
return; return;
var win, target = window, var win, target = window,
url = { url = this.params_from_uid(id, {_caps: this.browser_capabilities()});
_uid: id,
_mbox: this.get_message_mailbox(id),
// add browser capabilities, so we can properly handle attachments
_caps: this.browser_capabilities()
};
if (preview && (win = this.get_frame_window(this.env.contentframe))) { if (preview && (win = this.get_frame_window(this.env.contentframe))) {
target = win; target = win;
@ -8049,6 +8044,18 @@ function rcube_webmail()
return msg.mbox || this.env.mailbox; return msg.mbox || this.env.mailbox;
}; };
// build request parameters from single message id (maybe with mailbox name)
this.params_from_uid = function(uid, params)
{
if (!params)
params = {};
params._uid = String(uid).split('-')[0];
params._mbox = this.get_message_mailbox(uid);
return params;
};
// gets cursor position // gets cursor position
this.get_caret_pos = function(obj) this.get_caret_pos = function(obj)
{ {

Loading…
Cancel
Save