예제 #1
0
     $dataListDb = \Bitrix\Sender\MailingTable::getList(array('select' => array('ID'), 'filter' => $arFilter, 'order' => array($by => $order)));
     while ($arRes = $dataListDb->fetch()) {
         $arID[] = $arRes['ID'];
     }
 }
 foreach ($arID as $ID) {
     if (strlen($ID) <= 0) {
         continue;
     }
     $ID = IntVal($ID);
     $dataPrimary = array('ID' => $ID);
     switch ($_REQUEST['action']) {
         case "delete":
             @set_time_limit(0);
             $DB->StartTransaction();
             $dataDeleteDb = \Bitrix\Sender\MailingTable::delete($dataPrimary);
             if (!$dataDeleteDb->isSuccess()) {
                 $DB->Rollback();
                 $lAdmin->AddGroupError(GetMessage("rub_del_err"), $ID);
             }
             $DB->Commit();
             break;
         case "activate":
         case "deactivate":
             $arFields["ACTIVE"] = $_REQUEST['action'] == "activate" ? "Y" : "N";
             $dataUpdateDb = \Bitrix\Sender\MailingTable::update($dataPrimary, $arFields);
             if (!$dataUpdateDb->isSuccess()) {
                 $LAST_ERROR = $dataUpdateDb->getErrorMessages();
                 $LAST_ERROR = $LAST_ERROR[0];
                 $lAdmin->AddGroupError(GetMessage("rub_save_error") . $LAST_ERROR, $ID);
             }