?><option value="<?=$flt_arr["ID"]?>"><?=htmlspecialcharsbx($flt_arr["NAME"])?> [<?=htmlspecialcharsbx($flt_arr["ID"])?>]</option><? endwhile?> </select> </td> </tr> <tr> <td><?echo GetMessage("MAIL_MSG_VIEW_ACT_RULE_DELETE")?></td> <td><input type="checkbox" name="DELETE_MESSAGE" value="Y"></td> </tr> <tr class="heading"><td colspan="2"><?=GetMessage("MAIL_MSG_VIEW_LOG")?></td></tr> <tr> <td colspan="2" align="center"> <?$ml_res = CMailLog::GetList(Array("ID"=>"ASC"), Array("MESSAGE_ID"=>$ID));?> <select style="width:80%;" size="5"> <?while($arr_log = $ml_res->GetNext()):?> <option>(<?=$arr_log["DATE_INSERT"]?>) <?=$arr_log["MESSAGE_TEXT"]?></option> <?endwhile;?> </select> </td> </tr> <?$tabControl->Buttons();?> <input type="hidden" name="save_form" value="Y"> <input <?if ($MOD_RIGHT<"W") echo "disabled" ?> type="submit" name="save" class="adm-btn-save" value="<?echo GetMessage("MAIL_MSG_VIEW_SAVE")?>"> <input <?if ($MOD_RIGHT<"W") echo "disabled" ?> type="submit" name="apply" value="<?echo GetMessage("MAIL_MSG_VIEW_APPLY")?>">
$oSort = new CAdminSorting($sTableID, "date_insert", "desc"); // инициализация сортировки $lAdmin = new CAdminList($sTableID, $oSort); // инициализация списка $filter = new CAdminFilter($sTableID . "_f_id", array(GetMessage("MAIL_LOG_FILT_MBOX"), GetMessage("MAIL_LOG_FILT_RULE"))); $arFilterFields = array("find_message_subject", "find_show_mess", "find_mailbox_id", "find_filter_id", "find_show_filt"); $lAdmin->InitFilter($arFilterFields); //инициализация фильтра if ($find_filter_id > 0 && $find_mailbox_id) { $mf = CMailFilter::GetList(array(), array("MAILBOX_ID" => $find_mailbox_id, "FILTER_ID" => $find_filter_id)); if (!$mf->Fetch()) { $find_filter_id = ""; } } $arFilter = array("ID" => $find_id, "MAILBOX_ID" => $find_mailbox_id, "FILTER_ID" => $find_filter_id, "MESSAGE_SUBJECT" => $find_message_subject); $rsData = CMailLog::GetList(array($by => $order), $arFilter); $rsData = new CAdminResult($rsData, $sTableID); $rsData->NavStart(50); // установка строки навигации $lAdmin->NavText($rsData->GetNavPrint(GetMessage("MAIL_LOG_NAVIGATION"))); $arHeaders = array(); $arHeaders[] = array("id" => "DATE_INSERT", "content" => GetMessage("MAIL_LOG_TIME"), "default" => true, "sort" => "date_insert"); $arHeaders[] = array("id" => "MESSAGE", "content" => GetMessage("MAIL_LOG_TEXT"), "default" => true, "sort" => "message"); $arHeaders[] = array("id" => "MAILBOX_NAME", "content" => GetMessage("MAIL_LOG_MBOX"), "default" => true, "sort" => "mailbox_name"); if ($find_show_filt == "Y") { $arHeaders[] = array("id" => "FILTER_NAME", "content" => GetMessage("MAIL_LOG_RULE"), "default" => true, "sort" => "filter_name"); } if ($find_show_mess == "Y") { $arHeaders[] = array("id" => "MESSAGE_SUBJECT", "content" => GetMessage("MAIL_LOG_MSG"), "default" => true, "sort" => "message_subject"); } $lAdmin->AddHeaders($arHeaders);
function Delete($ID) { global $DB; $ID = IntVal($ID); $db_msg = CMailMessage::GetList(Array(), Array("MAILBOX_ID"=>$ID)); while($msg = $db_msg->Fetch()) { if(!CMailMessage::Delete($msg["ID"])) return false; } $db_flt = CMailFilter::GetList(Array(), Array("MAILBOX_ID"=>$ID)); while($flt = $db_flt->Fetch()) { if(!CMailFilter::Delete($flt["ID"])) return false; } $db_log = CMailLog::GetList(Array(), Array("MAILBOX_ID"=>$ID)); while($log = $db_log->Fetch()) { if(!CMailLog::Delete($log["ID"])) return false; } $db_mbox = CMailbox::GetList(array('ID' => $ID, 'ACTIVE' => 'Y', '!USER_ID' => 0)); if ($mbox = $db_mbox->fetch()) { CUserCounter::Clear($mbox['USER_ID'], 'mail_unseen', $mbox['LID']); CUserOptions::DeleteOption('global', 'last_mail_check_'.$mbox['LID'], false, $mbox['USER_ID']); CUserOptions::DeleteOption('global', 'last_mail_check_success_'.$mbox['LID'], false, $mbox['USER_ID']); } CAgent::RemoveAgent("CMailbox::CheckMailAgent(".$ID.");", "mail"); $strSql = "DELETE FROM b_mail_message_uid WHERE MAILBOX_ID=".$ID; if(!$DB->Query($strSql, true)) return false; CMailbox::SMTPReload(); $strSql = "DELETE FROM b_mail_mailbox WHERE ID=".$ID; return $DB->Query($strSql, true); }
function Delete($ID) { global $DB; $ID = IntVal($ID); $db_msg = CMailMessage::GetList(array(), array("MAILBOX_ID" => $ID)); while ($msg = $db_msg->Fetch()) { if (!CMailMessage::Delete($msg["ID"])) { return false; } } $db_flt = CMailFilter::GetList(array(), array("MAILBOX_ID" => $ID)); while ($flt = $db_flt->Fetch()) { if (!CMailFilter::Delete($flt["ID"])) { return false; } } $db_log = CMailLog::GetList(array(), array("MAILBOX_ID" => $ID)); while ($log = $db_log->Fetch()) { if (!CMailLog::Delete($log["ID"])) { return false; } } CAgent::RemoveAgent("CMailbox::CheckMailAgent(" . $ID . ");", "mail"); $strSql = "DELETE FROM b_mail_message_uid WHERE MAILBOX_ID=" . $ID; if (!$DB->Query($strSql, true)) { return false; } CMailbox::SMTPReload(); $strSql = "DELETE FROM b_mail_mailbox WHERE ID=" . $ID; return $DB->Query($strSql, true); }