本文整理汇总了PHP中CEventMessage::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CEventMessage::Delete方法的具体用法?PHP CEventMessage::Delete怎么用?PHP CEventMessage::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CEventMessage
的用法示例。
在下文中一共展示了CEventMessage::Delete方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UnInstallEvent
function UnInstallEvent()
{
global $DB;
//Удаляем тип почтового события
$et = new CEventType();
$et->Delete($this->EVENT_NAME);
//Находим все почтовые шаблоные которые были привязаны к нашему типу
$DB->StartTransaction();
$emessage = new CEventMessage();
$rsMess = CEventMessage::GetList($by = "site_id", $order = "desc", array("TYPE_ID" => $this->EVENT_NAME));
//рекурсивно по одному удаляем найденные шаблоны
while ($events = $rsMess->GetNext()) {
$emessage->Delete(intval($events["ID"]));
$DB->Commit();
}
}
示例2: while
if ($_REQUEST['action_target'] == 'selected') {
$rsData = CEventMessage::GetList($by, $order, $arFilter);
while ($arRes = $rsData->Fetch()) {
$arID[] = $arRes['ID'];
}
}
foreach ($arID as $ID) {
if (strlen($ID) <= 0) {
continue;
}
$ID = IntVal($ID);
$emessage = new CEventMessage();
switch ($_REQUEST['action']) {
case "delete":
$DB->StartTransaction();
if (!$emessage->Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
} else {
$DB->Commit();
}
break;
case "activate":
case "deactivate":
$arFields = array("ACTIVE" => $_REQUEST['action'] == "activate" ? "Y" : "N");
if (!$emessage->Update($ID, $arFields)) {
$lAdmin->AddGroupError(GetMessage("MAIN_EDIT_ERROR") . ':' . $emessage->LAST_ERROR, $ID);
}
break;
}
}
示例3: UnInstallEvents
function UnInstallEvents()
{
global $DB;
$statusMes = array();
$dbStatus = $DB->Query("SELECT * FROM b_sale_status", true);
if ($dbStatus) {
while ($arStatus = $dbStatus->Fetch()) {
$statusMes[] = "SALE_STATUS_CHANGED_" . $arStatus["ID"];
}
}
$statusMes[] = "SALE_NEW_ORDER";
$statusMes[] = "SALE_ORDER_CANCEL";
$statusMes[] = "SALE_ORDER_PAID";
$statusMes[] = "SALE_ORDER_DELIVERY";
$statusMes[] = "SALE_RECURRING_CANCEL";
$statusMes[] = "SALE_STATUS_CHANGED";
$statusMes[] = "SALE_ORDER_REMIND_PAYMENT";
$statusMes[] = "SALE_NEW_ORDER_RECURRING";
$statusMes[] = "SALE_ORDER_TRACKING_NUMBER";
$statusMes[] = "SALE_SUBSCRIBE_PRODUCT";
$eventType = new CEventType();
$eventM = new CEventMessage();
foreach ($statusMes as $v) {
$eventType->Delete($v);
$dbEvent = CEventMessage::GetList($b = "ID", $order = "ASC", array("EVENT_NAME" => $v));
while ($arEvent = $dbEvent->Fetch()) {
$eventM->Delete($arEvent["ID"]);
}
}
return true;
}
示例4: Delete
function Delete($ID, $CHECK_RIGHTS = "Y")
{
global $DB, $strError;
$err_mess = CAllForm::err_mess() . "<br>Function: Delete<br>Line: ";
$ID = intval($ID);
if ($CHECK_RIGHTS != "Y" || CForm::IsAdmin()) {
// delete form results
if (CForm::Reset($ID, "N")) {
// delete temporary template
$tmp_filename = $_SERVER["DOCUMENT_ROOT"] . BX_PERSONAL_ROOT . "/tmp/form/form_" . $ID . ".php";
if (file_exists($tmp_filename)) {
@unlink($tmp_filename);
}
// delete form statuses
$rsStatuses = CFormStatus::GetList($ID, $by, $order, $arFilter, $is_filtered);
while ($arStatus = $rsStatuses->Fetch()) {
CFormStatus::Delete($arStatus["ID"], "N");
}
// delete from fields & questions
$rsFields = CFormField::GetList($ID, "ALL", $by, $order, array(), $is_filtered);
while ($arField = $rsFields->Fetch()) {
CFormField::Delete($arField["ID"], "N");
}
// delete form image
$strSql = "SELECT IMAGE_ID FROM b_form WHERE ID='{$ID}' and IMAGE_ID>0";
$z = $DB->Query($strSql, false, $err_mess . __LINE__);
while ($zr = $z->Fetch()) {
CFile::Delete($zr["IMAGE_ID"]);
}
// delete mail event type and mail templates, assigned to the current form
$q = CForm::GetByID($ID);
$qr = $q->Fetch();
if (strlen(trim($qr["MAIL_EVENT_TYPE"])) > 0) {
// delete mail templates
$em = new CEventMessage();
$e = $em->GetList($by = "id", $order = "desc", array("EVENT_NAME" => $qr["MAIL_EVENT_TYPE"], "EVENT_NAME_EXACT_MATCH" => "Y"));
while ($er = $e->Fetch()) {
$em->Delete($er["ID"]);
}
// delete mail event type
$et = new CEventType();
$et->Delete($qr["MAIL_EVENT_TYPE"]);
}
// delete site assignment
$DB->Query("DELETE FROM b_form_2_site WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// delete mail templates assignment
$DB->Query("DELETE FROM b_form_2_mail_template WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// delete form menu
$DB->Query("DELETE FROM b_form_menu WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// delete from rights
$DB->Query("DELETE FROM b_form_2_group WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// and finally delete form
$DB->Query("DELETE FROM b_form WHERE ID='{$ID}'", false, $err_mess . __LINE__);
return true;
}
} else {
$strError .= GetMessage("FORM_ERROR_ACCESS_DENIED") . "<br>";
}
return false;
}
示例5: deleteMailTemplate
protected function deleteMailTemplate()
{
$mail_template_id = (int) \Bitrix\Main\Config\Option::get($this->MODULE_ID, "mail_template_id");
CEventMessage::Delete($mail_template_id);
return true;
}
示例6: elseif
$ANS_ID = $arAnswer["ANS_NEW"] == "Y" ? false : $arAnswer["ID"];
CFormAnswer::Set($arAnswerFields, $ANS_ID);
}
}
}
}
}
if ($bSimple) {
// mail template
$arr = CForm::GetTemplateList("MAIL", "xxx", $res);
if ($_REQUEST['USE_MAIL_TEMPLATE'] && count($arr['reference_id']) == 0) {
CForm::SetMailTemplate($res, "Y");
} elseif (!$_REQUEST['USE_MAIL_TEMPLATE'] && count($arr['reference_id']) > 0) {
reset($arr['reference_id']);
while (list($num, $tmp_id) = each($arr['reference_id'])) {
CEventMessage::Delete($tmp_id);
}
}
$arr = CForm::GetTemplateList("MAIL", "xxx", $res);
$arFields['SID'] = "SIMPLE_FORM_{$res}";
$arFields['arMAIL_TEMPLATE'] = $arr['reference_id'];
CForm::Set($arFields, $res);
// create default status
if ($ID == 0) {
$arFields_status = array("FORM_ID" => $res, "C_SORT" => 100, "ACTIVE" => "Y", "TITLE" => "DEFAULT", "DESCRIPTION" => "DEFAULT", "CSS" => "statusgreen", "DEFAULT_VALUE" => "Y", "arPERMISSION_VIEW" => array(0), "arPERMISSION_MOVE" => array(0), "arPERMISSION_EDIT" => array(0), "arPERMISSION_DELETE" => array(0));
CFormStatus::Set($arFields_status, 0);
}
}
if (strlen($strError) <= 0 && $ID > 0) {
$arCrmParams = array('CRM_ID' => $_REQUEST['CRM_ID'], 'LINK_TYPE' => $_REQUEST['CRM_LINK_TYPE'], 'CRM_FIELDS' => $_REQUEST['CRM_FIELD'], 'FORM_FIELDS' => $_REQUEST['CRM_FORM_FIELD']);
CFormCrm::SetForm($ID, $arCrmParams);
示例7: foreach
$arID[] = $arRes['EVENT_NAME'];
}
}
foreach ($arID as $ID) {
if (strLen($ID) <= 0) {
continue;
}
switch ($_REQUEST['action']) {
case "delete":
case "clean":
$DB->StartTransaction();
$ID = array("EVENT_NAME" => $ID);
$db_res = CEventMessage::GetList($by, $order, $ID);
if ($db_res && ($res = $db_res->Fetch())) {
do {
if (!CEventMessage::Delete($res["ID"])) {
$error = true;
break;
}
} while ($res = $db_res->Fetch());
}
if ($error || !CEventType::Delete($ID)) {
$DB->Rollback();
$lAdmin->AddGroupError(GetMessage("DELETE_ERROR"), $ID);
} else {
$DB->Commit();
}
break;
}
}
}
示例8: in
<?php
/*
$DB->Query("DELETE FROM b_event_type WHERE EVENT_NAME in (
'TICKET_NEW_FOR_AUTHOR',
'TICKET_NEW_FOR_TECHSUPPORT',
'TICKET_CHANGE_FOR_TECHSUPPORT',
'TICKET_CHANGE_BY_AUTHOR_FOR_AUTHOR',
'TICKET_CHANGE_BY_SUPPORT_FOR_AUTHOR',
'TICKET_OVERDUE_REMINDER'
)");
$DB->Query("DELETE FROM b_event_message WHERE EVENT_NAME in (
'TICKET_NEW_FOR_AUTHOR',
'TICKET_NEW_FOR_TECHSUPPORT',
'TICKET_CHANGE_FOR_TECHSUPPORT',
'TICKET_CHANGE_BY_AUTHOR_FOR_AUTHOR',
'TICKET_CHANGE_BY_SUPPORT_FOR_AUTHOR',
'TICKET_OVERDUE_REMINDER'
)");
*/
$arEventNames = array('TICKET_NEW_FOR_AUTHOR', 'TICKET_NEW_FOR_TECHSUPPORT', 'TICKET_CHANGE_FOR_TECHSUPPORT', 'TICKET_CHANGE_BY_AUTHOR_FOR_AUTHOR', 'TICKET_CHANGE_BY_SUPPORT_FOR_AUTHOR', 'TICKET_OVERDUE_REMINDER', 'TICKET_GENERATE_SUPERCOUPON');
$rs = CEventMessage::GetList($v1, $v2, array('EVENT_NAME' => implode('|', $arEventNames)));
while ($arEventMessage = $rs->Fetch()) {
CEventMessage::Delete($arEventMessage['ID']);
}
foreach ($arEventNames as $e) {
CEventType::Delete($e);
}
示例9: UnInstallEvents
function UnInstallEvents()
{
//Comment
$EM = new CEventMessage();
$oEventMessgae = $EM->GetList($by = "", $order = "", array("EVENT_NAME" => "ADD_IDEA_COMMENT"));
while ($arEvent = $oEventMessgae->Fetch()) {
$EM->Delete($arEvent["ID"]);
}
$ET = new CEventType();
$ET->Delete("ADD_IDEA_COMMENT");
//Idea
$oEventMessgae = $EM->GetList($by = "", $order = "", array("EVENT_NAME" => "ADD_IDEA"));
while ($arEvent = $oEventMessgae->Fetch()) {
$EM->Delete($arEvent["ID"]);
}
$ET->Delete("ADD_IDEA");
return true;
}
示例10: DeleteTemplateMailEvent
function DeleteTemplateMailEvent()
{
$arFilter = array("TYPE_ID" => "STALL_EMAIL", "ACTIVE" => "Y");
$dbType = CEventMessage::GetList($by = "ID", $order = "DESC", $arFilter);
while ($arType = $dbType->GetNext()) {
$mEvent = new CEventMessage();
$mEvent->Delete(intval($arType['ID']));
}
}
示例11: UnInstallEvents
function UnInstallEvents()
{
$dbEvent = CEventMessage::GetList($by, $order, array("EVENT_NAME" => "LDAP_USER_CONFIRM"));
while ($arEvent = $dbEvent->Fetch()) {
CEventMessage::Delete($arEvent["ID"]);
}
$eventType = new CEventType();
$eventType->Delete("LDAP_USER_CONFIRM");
return true;
}
示例12: Delete
function Delete($ID, $CHECK_RIGHTS = "Y")
{
global $DB, $strError;
$err_mess = CAllForm::err_mess() . "<br>Function: Delete<br>Line: ";
$ID = intval($ID);
if ($CHECK_RIGHTS != "Y" || CForm::IsAdmin()) {
// удаляем результаты формы
if (CForm::Reset($ID, "N")) {
// удаляем статусы формы
$rsStatuses = CFormStatus::GetList($ID, $by, $order, $arFilter, $is_filtered);
while ($arStatus = $rsStatuses->Fetch()) {
CFormStatus::Delete($arStatus["ID"], "N");
}
// удаляем поля и вопросы формы
$rsFields = CFormField::GetList($ID, "ALL", $by, $order, array(), $is_filtered);
while ($arField = $rsFields->Fetch()) {
CFormField::Delete($arField["ID"], "N");
}
// удаляем изображения формы
$strSql = "SELECT IMAGE_ID FROM b_form WHERE ID='{$ID}' and IMAGE_ID>0";
$z = $DB->Query($strSql, false, $err_mess . __LINE__);
while ($zr = $z->Fetch()) {
CFile::Delete($zr["IMAGE_ID"]);
}
// удаляем тип почтового события и почтовые шаблоны приписанные данной форме
$q = CForm::GetByID($ID);
$qr = $q->Fetch();
if (strlen(trim($qr["MAIL_EVENT_TYPE"])) > 0) {
// удалим почтовые шаблоны
$em = new CEventMessage();
$e = $em->GetList($by = "id", $order = "desc", array("EVENT_NAME" => $qr["MAIL_EVENT_TYPE"], "EVENT_NAME_EXACT_MATCH" => "Y"));
while ($er = $e->Fetch()) {
$em->Delete($er["ID"]);
}
// удалим тип почтового события
$et = new CEventType();
$et->Delete($qr["MAIL_EVENT_TYPE"]);
}
// удаляем привязку к сайтам
$DB->Query("DELETE FROM b_form_2_site WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// удаляем привязку к почтовым шаблонам
$DB->Query("DELETE FROM b_form_2_mail_template WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// удаляем меню формы
$DB->Query("DELETE FROM b_form_menu WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// удаляем права групп
$DB->Query("DELETE FROM b_form_2_group WHERE FORM_ID='{$ID}'", false, $err_mess . __LINE__);
// удаляем форму
$DB->Query("DELETE FROM b_form WHERE ID='{$ID}'", false, $err_mess . __LINE__);
return true;
}
} else {
$strError .= GetMessage("FORM_ERROR_ACCESS_DENIED") . "<br>";
}
return false;
}
示例13: UnInstallEvents
public function UnInstallEvents()
{
$et = new CEventType();
$et->Delete('SPM_CMIOS_NEW_ORDER');
$res = CEventMessage::GetList($by = 'id', $order = 'asc', array('TYPE_ID' => 'SPM_CMIOS_NEW_ORDER'));
while ($row = $res->GetNext()) {
$em = new CEventMessage();
$em->Delete($row['ID']);
}
return true;
}