X-Git-Url: https://git.proxmox.com/?p=pmg-gui.git;a=blobdiff_plain;f=js%2FSpamQuarantine.js;h=5c6865b31e5eef17e05a86c655a40632ef0520ef;hp=cec03c169e8c30a672f3f2321c7c43cc657440f2;hb=d42f85b8061923d5a5ca82fc3ec6808fcbc26e1c;hpb=ebe4d3d940eb8d550b1b430b8b8540d55e77eae2 diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js index cec03c1..5c6865b 100644 --- a/js/SpamQuarantine.js +++ b/js/SpamQuarantine.js @@ -63,9 +63,25 @@ Ext.define('PMG.SpamQuarantine', { var url = '/api2/htmlmail/quarantine/content?id=' + rec.data.id + ((raw)?'&raw=1':''); preview.setDisabled(false); + this.lookupReference('raw').setDisabled(false); + this.lookupReference('spam').setDisabled(false); preview.update(""); }, + multiSelect: function() { + var preview = this.lookupReference('preview'); + var raw = this.lookupReference('raw'); + var spam = this.lookupReference('spam'); + var spaminfo = this.lookupReference('spaminfo'); + + preview.setDisabled(false); + preview.update('

' + gettext('Multiple E-Mails selected') + '

'); + raw.setDisabled(true); + spam.setDisabled(true); + spam.setPressed(false); + spaminfo.setVisible(false); + }, + toggleRaw: function(button) { var me = this; var list = this.lookupReference('list'); @@ -83,6 +99,30 @@ Ext.define('PMG.SpamQuarantine', { var action = button.reference; + if (selected.length > 1) { + var idlist = []; + selected.forEach(function(item) { + idlist.push(item.data.id); + }); + Ext.Msg.confirm( + gettext('Confirm'), + Ext.String.format( + gettext("Action '{0}' for '{1}' items"), + action, selected.length + ), + function(button) { + if (button !== 'yes') { + return; + } + + PMG.Utils.doQuarantineAction(action, idlist.join(';'), function() { + list.getController().load(); + }); + } + ); + return; + } + PMG.Utils.doQuarantineAction(action, selected[0].data.id, function() { list.getController().load(); }); @@ -91,6 +131,11 @@ Ext.define('PMG.SpamQuarantine', { onSelectMail: function() { var me = this; var list = this.lookupReference('list'); + var selection = list.selModel.getSelection(); + if (selection.length > 1) { + me.multiSelect(); + return; + } var rec = list.selModel.getSelection()[0]; me.updatePreview(me.raw || false, rec);