Esempio n. 1
0
    $groupDb = \Bitrix\Sender\MailingGroupTable::getList(array('select' => array('ID' => 'GROUP_ID', 'INCLUDE'), 'filter' => array('MAILING_ID' => $ID)));
    while ($arGroup = $groupDb->fetch()) {
        if ($arGroup['INCLUDE']) {
            $GROUP_INCLUDE[] = $arGroup['ID'];
        } else {
            $GROUP_EXCLUDE[] = $arGroup['ID'];
        }
    }
}
//Edit/Add part
ClearVars();
$str_SORT = 100;
$str_ACTIVE = "Y";
$str_VISIBLE = "Y";
if ($ID > 0) {
    $rubric = new CDBResult(\Bitrix\Sender\MailingTable::getById($ID));
    if (!$rubric->ExtractFields("str_")) {
        $ID = 0;
    }
}
$GROUP_EXIST = array();
$groupDb = \Bitrix\Sender\GroupTable::getList(array('select' => array('NAME', 'ID', 'ADDRESS_COUNT'), 'filter' => array('ACTIVE' => 'Y'), 'order' => array('SORT' => 'ASC', 'NAME' => 'ASC')));
while ($arGroup = $groupDb->fetch()) {
    $GROUP_EXIST[] = $arGroup;
}
if ($bVarsFromForm) {
    $DB->InitTableVarsForEdit("b_sender_mailing", "", "str_");
}
\CJSCore::Init(array("sender_admin"));
$APPLICATION->SetTitle($ID > 0 ? GetMessage("sender_mailing_edit_title_edit") . $ID : GetMessage("sender_mailing_edit_title_new"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";