diff --git a/acptemplate/chatSuspensionList.tpl b/acptemplate/chatSuspensionList.tpl index b57d67a..62ec21c 100644 --- a/acptemplate/chatSuspensionList.tpl +++ b/acptemplate/chatSuspensionList.tpl @@ -5,6 +5,33 @@ $(function() { new WCF.Search.User('#username', null, false, [ ], false); new WCF.Search.User('#issuerUsername', null, false, [ ], false); + + var proxy = new WCF.Action.Proxy({ + success: function (data, textStatus, jqXHR) { + $('.jsSuspensionRow').each(function(index, row) { + var row = $(row); + if (WCF.inArray(row.data('objectID'), data.objectIDs)) { + row.find('.jsRevokeButton').addClass('disabled').removeClass('pointer').off('click'); + + (new WCF.System.Notification('{"chat.acp.suspension.revoke.success"|language|encodeJS}')).show(); + } + }); + } + }); + $('.jsRevokeButton:not(.disabled)').click(function () { + var objectID = $(this).parents('.jsSuspensionRow').data('objectID'); + + WCF.System.Confirmation.show($(this).data('confirmMessage'), $.proxy(function (action) { + if (action === 'confirm') { + proxy.setOption('data', { + actionName: 'revoke', + className: '\\chat\\data\\suspension\\SuspensionAction', + objectIDs: [ objectID ] + }); + proxy.sendRequest(); + } + }, this)); + }); }); //]]> @@ -108,7 +135,7 @@ {foreach from=$objects item=$suspension} - + {event name='rowButtons'} {#$suspension->suspensionID} diff --git a/file/lib/data/suspension/SuspensionAction.class.php b/file/lib/data/suspension/SuspensionAction.class.php index 8b5ca77..b0bf7e6 100644 --- a/file/lib/data/suspension/SuspensionAction.class.php +++ b/file/lib/data/suspension/SuspensionAction.class.php @@ -1,5 +1,6 @@ checkPermissions((array) 'admin.chat.canManageSuspensions'); + + $this->parameters['revoker'] = WCF::getUser()->userID; + } + /** * Revokes suspensions. */