Beispiel #1
0
        }
    }
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin_js.php";
}
if (check_bitrix_sessid() && $POST_RIGHT >= "W" && isset($_REQUEST["action"]) && in_array($_REQUEST["action"], array('js_pause', 'js_stop', 'js_send_error'))) {
    require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_js.php";
    $message = null;
    $mailingChain = MailingChainTable::getRowById(array('ID' => $ID));
    if ($_REQUEST["action"] == "js_pause" && in_array($mailingChain['STATUS'], array(MailingChainTable::STATUS_SEND, MailingChainTable::STATUS_WAIT))) {
        MailingChainTable::update(array('ID' => $ID), array('STATUS' => MailingChainTable::STATUS_PAUSE));
        $message = GetMessage("MAILING_ADM_SENDING_PAUSE");
    } elseif ($_REQUEST["action"] == "js_stop" && $mailingChain['STATUS'] == MailingChainTable::STATUS_PAUSE) {
        MailingChainTable::update(array('ID' => $ID), array('STATUS' => MailingChainTable::STATUS_END));
        $message = GetMessage("MAILING_ADM_SENDING_STOP");
    } elseif ($_REQUEST["action"] == "js_send_error" && MailingChainTable::canReSendErrorRecipients($ID)) {
        MailingChainTable::prepareReSendErrorRecipients($ID);
        $message = GetMessage("MAILING_ADM_SENDING_PLANING");
    }
    if ($message) {
        $adminMessage = new CAdminMessage(array("MESSAGE" => $message, "TYPE" => "OK"));
        echo $adminMessage->show();
    }
    ?>
	<script><?php 
    echo $sTableID;
    ?>
.GetAdminList('<?php 
    echo $APPLICATION->GetCurPage();
    ?>
?MAILING_ID=<?php 
    echo $MAILING_ID;