本文整理汇总了PHP中CBPDocument::OnDocumentDelete方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::OnDocumentDelete方法的具体用法?PHP CBPDocument::OnDocumentDelete怎么用?PHP CBPDocument::OnDocumentDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPDocument
的用法示例。
在下文中一共展示了CBPDocument::OnDocumentDelete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnAfterIBlockElementDelete
public function OnAfterIBlockElementDelete($fields)
{
$errors = array();
if (Loader::includeModule('socialnetwork')) {
$states = CBPStateService::getDocumentStates(array('lists', 'BizprocDocument', $fields['ID']));
foreach ($states as $workflowId => $state) {
$sourceId = CBPStateService::getWorkflowIntegerId($workflowId);
$resultQuery = CSocNetLog::getList(array(), array('EVENT_ID' => 'lists_new_element', 'SOURCE_ID' => $sourceId), false, false, array('ID'));
while ($log = $resultQuery->fetch()) {
CSocNetLog::Delete($log['ID']);
}
}
}
CBPDocument::OnDocumentDelete(array('lists', 'BizprocDocument', $fields['ID']), $errors);
}
示例2: OnAfterIBlockElementDelete
public function OnAfterIBlockElementDelete($arFields)
{
CBPDocument::OnDocumentDelete(array("bizproc", "CBPVirtualDocument", $arFields["ID"]), $arErrorsTmp);
}
示例3: ProcessDeletion
public function ProcessDeletion($ID)
{
if (!CModule::IncludeModule('bizproc')) {
return true;
}
$arErrorsTmp = array();
CBPDocument::OnDocumentDelete(array('crm', $this->sDocument, $this->sEntityType . '_' . $ID), $arErrorsTmp);
if (count($arErrorsTmp) > 0) {
$this->LAST_ERROR = '';
foreach ($arErrorsTmp as $e) {
$this->LAST_ERROR .= $e['message'] . '<br />';
}
return false;
}
return true;
}
示例4: Delete
//.........这里部分代码省略.........
return false;
}
} else {
if (!$DB->Query("DELETE FROM b_iblock_element_property WHERE IBLOCK_ELEMENT_ID = " . $elementId)) {
return false;
}
}
static $arDelCache = array();
if (!is_set($arDelCache, $zr["IBLOCK_ID"])) {
$arDelCache[$zr["IBLOCK_ID"]] = false;
$db_ps = $DB->Query("SELECT ID,IBLOCK_ID,VERSION,MULTIPLE FROM b_iblock_property WHERE PROPERTY_TYPE='E' AND (LINK_IBLOCK_ID=" . $zr["IBLOCK_ID"] . " OR LINK_IBLOCK_ID=0 OR LINK_IBLOCK_ID IS NULL)");
while ($ar_ps = $db_ps->Fetch()) {
if ($ar_ps["VERSION"] == 2) {
if ($ar_ps["MULTIPLE"] == "Y") {
$strTable = "b_iblock_element_prop_m" . $ar_ps["IBLOCK_ID"];
} else {
$strTable = "b_iblock_element_prop_s" . $ar_ps["IBLOCK_ID"];
}
} else {
$strTable = "b_iblock_element_property";
}
$arDelCache[$zr["IBLOCK_ID"]][$strTable][] = $ar_ps["ID"];
}
}
if ($arDelCache[$zr["IBLOCK_ID"]]) {
foreach ($arDelCache[$zr["IBLOCK_ID"]] as $strTable => $arProps) {
if (strncmp("b_iblock_element_prop_s", $strTable, 23) == 0) {
$tableFields = $DB->GetTableFields($strTable);
foreach ($arProps as $prop_id) {
$strSql = "UPDATE " . $strTable . " SET PROPERTY_" . $prop_id . "=null";
if (isset($tableFields["DESCRIPTION_" . $prop_id])) {
$strSql .= ",DESCRIPTION_" . $prop_id . "=null";
}
$strSql .= " WHERE PROPERTY_" . $prop_id . "=" . $zr["ID"];
if (!$DB->Query($strSql)) {
return false;
}
}
} elseif (strncmp("b_iblock_element_prop_m", $strTable, 23) == 0) {
$tableFields = $DB->GetTableFields(str_replace("prop_m", "prop_s", $strTable));
$strSql = "SELECT IBLOCK_PROPERTY_ID, IBLOCK_ELEMENT_ID FROM " . $strTable . " WHERE IBLOCK_PROPERTY_ID IN (" . implode(", ", $arProps) . ") AND VALUE_NUM=" . $zr["ID"];
$rs = $DB->Query($strSql);
while ($ar = $rs->Fetch()) {
$strSql = "\n\t\t\t\t\t\t\t\t\tUPDATE " . str_replace("prop_m", "prop_s", $strTable) . "\n\t\t\t\t\t\t\t\t\tSET PROPERTY_" . $ar["IBLOCK_PROPERTY_ID"] . "=null\n\t\t\t\t\t\t\t\t\t" . (isset($tableFields["DESCRIPTION_" . $ar["IBLOCK_PROPERTY_ID"]]) ? ",DESCRIPTION_" . $ar["IBLOCK_PROPERTY_ID"] . "=null" : "") . "\n\t\t\t\t\t\t\t\t\tWHERE IBLOCK_ELEMENT_ID = " . $ar["IBLOCK_ELEMENT_ID"] . "\n\t\t\t\t\t\t\t\t";
if (!$DB->Query($strSql)) {
return false;
}
}
$strSql = "DELETE FROM " . $strTable . " WHERE IBLOCK_PROPERTY_ID IN (" . implode(", ", $arProps) . ") AND VALUE_NUM=" . $zr["ID"];
if (!$DB->Query($strSql)) {
return false;
}
} else {
$strSql = "DELETE FROM " . $strTable . " WHERE IBLOCK_PROPERTY_ID IN (" . implode(", ", $arProps) . ") AND VALUE_NUM=" . $zr["ID"];
if (!$DB->Query($strSql)) {
return false;
}
}
}
}
if (!$DB->Query("DELETE FROM b_iblock_section_element WHERE IBLOCK_ELEMENT_ID = " . $elementId)) {
return false;
}
$obIBlockElementRights = new CIBlockElementRights($zr["IBLOCK_ID"], $zr["ID"]);
$obIBlockElementRights->DeleteAllRights();
$ipropTemplates = new \Bitrix\Iblock\InheritedProperty\ElementTemplates($zr["IBLOCK_ID"], $zr["ID"]);
$ipropTemplates->delete();
if (IntVal($zr["WF_PARENT_ELEMENT_ID"]) <= 0 && $zr["WF_STATUS_ID"] == 1 && CModule::IncludeModule("search")) {
CSearch::DeleteIndex("iblock", $elementId);
}
CIBlockElement::DeleteFile($zr["PREVIEW_PICTURE"], $zr["ID"], "PREVIEW", $zr["WF_PARENT_ELEMENT_ID"], $zr["IBLOCK_ID"]);
CIBlockElement::DeleteFile($zr["DETAIL_PICTURE"], $zr["ID"], "DETAIL", $zr["WF_PARENT_ELEMENT_ID"], $zr["IBLOCK_ID"]);
if (CModule::IncludeModule("workflow")) {
$DB->Query("DELETE FROM b_workflow_move WHERE IBLOCK_ELEMENT_ID=" . $elementId);
}
$DB->Query("DELETE FROM b_iblock_element_lock WHERE IBLOCK_ELEMENT_ID=" . $elementId);
$DB->Query("DELETE FROM b_rating_vote WHERE ENTITY_TYPE_ID = 'IBLOCK_ELEMENT' AND ENTITY_ID = " . $elementId);
$DB->Query("DELETE FROM b_rating_voting WHERE ENTITY_TYPE_ID = 'IBLOCK_ELEMENT' AND ENTITY_ID = " . $elementId);
if (!$DB->Query("DELETE FROM b_iblock_element WHERE ID=" . $elementId)) {
return false;
}
if (isset(self::$elementIblock[$elementId])) {
unset(self::$elementIblock[$elementId]);
}
\Bitrix\Iblock\PropertyIndex\Manager::deleteElementIndex($zr["IBLOCK_ID"], $piId);
if (CModule::IncludeModule("bizproc")) {
CBPDocument::OnDocumentDelete(array("iblock", "CIBlockDocument", $zr["ID"]), $arErrorsTmp);
}
foreach (GetModuleEvents("iblock", "OnAfterIBlockElementDelete", true) as $arEvent) {
ExecuteModuleEventEx($arEvent, array($zr));
}
CIBlock::clearIblockTagCache($zr['IBLOCK_ID']);
unset($elementId);
}
}
/************* QUOTA *************/
$_SESSION["SESS_RECOUNT_DB"] = "Y";
/************* QUOTA *************/
return true;
}
示例5: GetMessage
$ar = CIBlockType::GetByIDLang($arParams["IBLOCK_TYPE"], LANGUAGE_ID, true);
if ($ar) {
$arResult["BlockType"] = $ar;
} else {
$arResult["FatalErrorMessage"] .= GetMessage("BPWC_WIC_WRONG_IBLOCK_TYPE") . ". ";
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$arResult["AdminAccess"] = $USER->IsAdmin() || is_array($arParams["ADMIN_ACCESS"]) && count(array_intersect($USER->GetUserGroupArray(), $arParams["ADMIN_ACCESS"])) > 0;
$deleteBlockId = intval($_REQUEST["delete_block_id"]);
if ($deleteBlockId > 0 && $arResult["AdminAccess"] && check_bitrix_sessid()) {
$db = CIBlock::GetList(array(), array("ID" => $deleteBlockId, "SITE_ID" => SITE_ID, "TYPE" => $arParams["IBLOCK_TYPE"]));
if ($ar = $db->GetNext()) {
$db1 = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $ar["ID"], "SHOW_NEW" => "Y"), false, false, array("IBLOCK_ID", "ID"));
while ($ar1 = $db1->Fetch()) {
CBPDocument::OnDocumentDelete(array("bizproc", "CBPVirtualDocument", $ar1["ID"]), $arErrorsTmp);
}
$db2 = CBPWorkflowTemplateLoader::GetList(array(), array("DOCUMENT_TYPE" => array("bizproc", "CBPVirtualDocument", "type_" . $ar["ID"])), false, false, array("ID"));
while ($ar2 = $db2->Fetch()) {
CBPWorkflowTemplateLoader::Delete($ar2["ID"]);
}
CIBlock::Delete($ar["ID"]);
}
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$arResult["Blocks"] = array();
$dbBlockList = CIBlock::GetList(array("SORT" => "ASC", "NAME" => "ASC"), array("ACTIVE" => "Y", "SITE_ID" => SITE_ID, "TYPE" => $arParams["IBLOCK_TYPE"]));
while ($arBlock = $dbBlockList->GetNext()) {
$arBlock["LIST_URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LIST"], array("block_id" => $arBlock["ID"]));
if (intval($arBlock["PICTURE"]) <= 0) {
示例6: foreach
foreach ($arErrorsTmp as $e) {
$arResult["ErrorMessage"] .= $e["message"] . ". ";
}
}
} else {
$arResult["ErrorMessage"] .= GetMessage("BPWC_WLC_MISSING_BP") . ". ";
}
if (strlen($arResult["ErrorMessage"]) <= 0) {
LocalRedirect($APPLICATION->GetCurPageParam("", array("sessid", "stop_bizproc_id", "delete_bizproc_id")));
}
}
if ($_SERVER["REQUEST_METHOD"] == "GET" && strlen($_REQUEST["delete_bizproc_id"]) > 0 && check_bitrix_sessid() && $arResult["AllowAdmin"]) {
$arState = CBPStateService::GetWorkflowState($_REQUEST["delete_bizproc_id"]);
if (count($arState) > 0) {
$arErrorsTmp = array();
CBPDocument::OnDocumentDelete($arState["DOCUMENT_ID"], $arErrorsTmp);
if (count($arErrorsTmp) > 0) {
foreach ($arErrorsTmp as $e) {
$arResult["ErrorMessage"] .= $e["message"] . ". ";
}
}
if (strlen($arResult["ErrorMessage"]) <= 0) {
CIBlockElement::Delete($arState["DOCUMENT_ID"][2]);
}
} else {
$arResult["ErrorMessage"] .= GetMessage("BPWC_WLC_MISSING_BP") . ". ";
}
if (strlen($arResult["ErrorMessage"]) <= 0) {
LocalRedirect($APPLICATION->GetCurPageParam("", array("sessid", "stop_bizproc_id", "delete_bizproc_id")));
}
}
示例7: OnAfterIBlockElementDelete
public static function OnAfterIBlockElementDelete($arFields)
{
CBPDocument::OnDocumentDelete(array("webdav", "CIBlockDocumentWebdav", $arFields["ID"]), $arErrorsTmp);
CBPDocument::OnDocumentDelete(array("webdav", "CIBlockDocumentWebdavSocnet", $arFields["ID"]), $arErrorsTmp);
}
示例8: DeleteDocument
/**
* Метод удаляет указанный документ.
*
* @param string $documentId - код документа.
*/
public function DeleteDocument($documentId)
{
$documentId = intval($documentId);
if ($documentId <= 0) {
throw new CBPArgumentNullException("documentId");
}
CIBlockElement::Delete($documentId);
CBPDocument::OnDocumentDelete(array("intranet", "CIntranetTasksDocument", $documentId), $arError);
if (count($arError) > 0) {
throw new Exception($arError[0]["message"]);
}
}