本文整理汇总了PHP中CBPWorkflowTemplateLoader::Delete方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPWorkflowTemplateLoader::Delete方法的具体用法?PHP CBPWorkflowTemplateLoader::Delete怎么用?PHP CBPWorkflowTemplateLoader::Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPWorkflowTemplateLoader
的用法示例。
在下文中一共展示了CBPWorkflowTemplateLoader::Delete方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
$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) {
$arBlock["PICTURE"] = "/bitrix/images/bizproc/vd_bp.jpg";
}
$arMessagesTmp = CIBlock::GetMessages($arBlock["ID"]);
$arBlock["CreateTitle"] = htmlspecialcharsbx(is_array($arMessagesTmp) && array_key_exists("ELEMENT_ADD", $arMessagesTmp) ? $arMessagesTmp["ELEMENT_ADD"] : "");
示例2: DeleteWorkflowTemplate
/**
* Метод удаляет шаблон рабочего потока.
*
* @param int $id - код шаблона рабочего потока.
* @param array $documentType - код типа документа в виде массива array(модуль, сущность, код_типа_документа_в_модуле).
* @param array $arErrors - массив ошибок, которые произошли при выполнении в виде array(array("code" => код_ошибки, "message" => сообщение, "file" => путь_к_файлу), ...).
*/
public static function DeleteWorkflowTemplate($id, $documentType, &$arErrors)
{
$arErrors = array();
$dbTemplates = CBPWorkflowTemplateLoader::GetList(
array(),
array("ID" => $id, "DOCUMENT_TYPE" => $documentType),
false,
false,
array("ID")
);
$arTemplate = $dbTemplates->Fetch();
if (!$arTemplate)
{
$arErrors[] = array(
"code" => 0,
"message" => str_replace("#ID#", $id, GetMessage("BPCGDOC_INVALID_WF_ID")),
"file" => ""
);
return;
}
try
{
CBPWorkflowTemplateLoader::Delete($id);
}
catch (Exception $e)
{
$arErrors[] = array(
"code" => $e->getCode(),
"message" => $e->getMessage(),
"file" => $e->getFile()." [".$e->getLine()."]"
);
}
}