# --
# AdminProcessManagementPopupResponse.dtl - provides HTML for AdminProcessManagement
# Copyright (C) 2001-2012 OTRS AG, http://otrs.org/
# --
# $Id: AdminProcessManagementPopupResponse.dtl,v 1.10 2012/11/20 15:11:27 mh Exp $
# --
# This software comes with ABSOLUTELY NO WARRANTY. For details, see
# the enclosed file COPYING for license information (AGPL). If you
# did not receive this file, see http://www.gnu.org/licenses/agpl.txt.
# --
<div class="Spacing Center AJAXWaiting">
    <span class="AJAXLoader" title="$Text{"Loading"}"></span>
</div>

<!-- dtl:block:Redirect -->
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
var Data = {
    Action: "$Data{"Action"}",
    Subaction: "$Data{"Subaction"}",
    ID: "$Data{"ID"}",
    EntityID: "$Data{"EntityID"}",
    Field: "$Data{"Field"}",
};

// send results to main window
window.opener.Core.Agent.Admin.ProcessManagement.UpdateConfig($Data{"ConfigJSON"});

// reload popup
Core.App.InternalRedirect(Data);
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:Redirect -->

<!-- dtl:block:ClosePopup -->
<!--dtl:js_on_document_complete-->
<script type="text/javascript">//<![CDATA[
// update screen path
window.opener.Core.Agent.Admin.ProcessManagement.UpdateScreensPath(window, function (WindowObject) {
    //send results to main window
    WindowObject.opener.Core.Agent.Admin.ProcessManagement.UpdateConfig($Data{"ConfigJSON"});

    // update accordion
    WindowObject.opener.Core.Agent.Admin.ProcessManagement.UpdateAccordion();

    // update sync message
    WindowObject.opener.Core.Agent.Admin.ProcessManagement.UpdateSyncMessage();

    // redraw canvas
    WindowObject.opener.Core.Agent.Admin.ProcessManagement.Canvas.Redraw();

    // remove overlay
    WindowObject.opener.Core.Agent.Admin.ProcessManagement.HideOverlay();

    // remove onbeforeunload event (which is only needed if you close the popup via the window "X")
    $(WindowObject).unbind("beforeunload.PMPopup");

    // close popup
    WindowObject.close();
});
//]]></script>
<!--dtl:js_on_document_complete-->
<!-- dtl:block:ClosePopup -->
