From 794e411a4f1c5a4102dc7666bcc95fe6576d6a58 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Wed, 27 Dec 2017 12:53:49 +0100 Subject: [PATCH] doQuarantineAction: pass pmail parameter --- js/SpamQuarantine.js | 8 +++++++- js/Utils.js | 12 +++++++----- js/VirusQuarantine.js | 4 +++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/js/SpamQuarantine.js b/js/SpamQuarantine.js index cec03c1..56c6726 100644 --- a/js/SpamQuarantine.js +++ b/js/SpamQuarantine.js @@ -80,10 +80,16 @@ Ext.define('PMG.SpamQuarantine', { if (!selected.length) { return; } + var rec = selected[0]; var action = button.reference; - PMG.Utils.doQuarantineAction(action, selected[0].data.id, function() { + var receiver = list.user; + if (action === 'deliver' || action === 'delete') { + receiver = rec.data.receiver || list.user; + } + + PMG.Utils.doQuarantineAction(action, rec.data.id, receiver, function() { list.getController().load(); }); }, diff --git a/js/Utils.js b/js/Utils.js index dbc3e78..ca510c2 100644 --- a/js/Utils.js +++ b/js/Utils.js @@ -678,13 +678,15 @@ Ext.define('PMG.Utils', { } }, - doQuarantineAction: function(action, id, callback) { + doQuarantineAction: function(action, id, pmail, callback) { + var params = { + action: action, + id: id + }; + if (pmail !== undefined) { params.pmail = pmail; } Proxmox.Utils.API2Request({ url: '/quarantine/content/', - params: { - action: action, - id: id - }, + params: params, method: 'POST', failure: function(response, opts) { Ext.Msg.alert(gettext('Error'), response.htmlStatus); diff --git a/js/VirusQuarantine.js b/js/VirusQuarantine.js index b33568b..a3dead8 100644 --- a/js/VirusQuarantine.js +++ b/js/VirusQuarantine.js @@ -63,10 +63,12 @@ Ext.define('PMG.VirusQuarantine', { if (!selected.length) { return; } + var rec = selected[0]; var action = button.reference; + var receiver = rec.data.receiver; - PMG.Utils.doQuarantineAction(action, selected[0].data.id, function() { + PMG.Utils.doQuarantineAction(action, rec.data.id, receiver, function() { list.getController().load(); }); }, -- 2.39.2