当前位置: 首页>>代码示例>>PHP>>正文


PHP CBPDocument::AddDefaultWorkflowTemplates方法代码示例

本文整理汇总了PHP中CBPDocument::AddDefaultWorkflowTemplates方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::AddDefaultWorkflowTemplates方法的具体用法?PHP CBPDocument::AddDefaultWorkflowTemplates怎么用?PHP CBPDocument::AddDefaultWorkflowTemplates使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBPDocument的用法示例。


在下文中一共展示了CBPDocument::AddDefaultWorkflowTemplates方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: call_user_func_array

$arResult["STORAGE_ID"] = \Bitrix\Disk\BizProcDocument::generateDocumentType($arParams["STORAGE_ID"]);
$arParams["USER_GROUPS"] = $GLOBALS["USER"]->GetUserGroupArray();
if (method_exists($arParams["DOCUMENT_TYPE"][1], "GetUserGroups")) {
    $arParams["USER_GROUPS"] = call_user_func_array(array($arParams["ENTITY"], "GetUserGroups"), array($documentData['DISK']['DOCUMENT_TYPE'], $arResult["STORAGE_ID"], $GLOBALS["USER"]->GetID()));
}
if (empty($arError)) {
    if (!CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::CreateWorkflow, $GLOBALS["USER"]->GetID(), $documentData['DISK']['DOCUMENT_TYPE'], array("UserGroups" => $arParams["USER_GROUPS"]))) {
        $arError[] = array("id" => "access_denied", "text" => GetMessage("BPATT_NO_PERMS"));
    }
}
if (!empty($arError)) {
    $e = new CAdminException($arError);
    ShowError($e->GetString());
    return false;
} elseif ($_REQUEST['action'] == 'create_default') {
    CBPDocument::AddDefaultWorkflowTemplates($documentData['DISK']['DOCUMENT_TYPE']);
    LocalRedirect($APPLICATION->GetCurPageParam("", array("action", "sessid")));
} elseif ($_REQUEST['action'] == 'delete') {
    $arErrorsTmp = array();
    foreach ($documentData as $nameModule => $data) {
        $dbRes = CBPWorkflowTemplateLoader::GetList(array($by => $order), array("DOCUMENT_TYPE" => $data["DOCUMENT_TYPE"], "ID" => $_REQUEST["ID"]), false, false, array("ID"));
        $availabilityTemplate = $dbRes->Fetch();
        if (!empty($availabilityTemplate)) {
            CBPDocument::DeleteWorkflowTemplate($_REQUEST['ID'], $data["DOCUMENT_TYPE"], $arErrorsTmp);
        }
    }
    if (empty($arErrorsTmp)) {
        $url = !empty($_REQUEST["back_url"]) ? $_REQUEST["back_url"] : $APPLICATION->GetCurPageParam("", array("action", "sessid", "ID"));
        LocalRedirect($url);
    } elseif (!empty($arErrorsTmp)) {
        foreach ($arErrorsTmp as $e) {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例2: array

                         }
                     }
                 }
             }
         }
     }
     if (false == $boolFlag) {
         if ($ex = $APPLICATION->GetException()) {
             $strWarning .= $ex->GetString() . "<br>";
             $bVarsFromForm = true;
         }
     }
 }
 if (!$bVarsFromForm) {
     if ($bBizproc && $_REQUEST['BIZ_PROC_ADD_DEFAULT_TEMPLATES'] == 'Y' && CBPDocument::GetNumberOfWorkflowTemplatesForDocumentType(array("iblock", "CIBlockDocument", "iblock_" . $ID)) <= 0 && $arFields["BIZPROC"] == "Y") {
         CBPDocument::AddDefaultWorkflowTemplates(array("iblock", "CIBlockDocument", "iblock_" . $ID));
     }
     $DB->Commit();
     //Check if index needed
     CIBlock::CheckForIndexes($ID);
     if ($bCatalog) {
         if (isset($boolNeedAgent) && $boolNeedAgent == true) {
             $intYandexExport = CCatalog::GetList(array(), array('YANDEX_EXPORT' => 'Y'), array());
             CAgent::RemoveAgent("CCatalog::PreGenerateXML(\"yandex\");", "catalog");
             if (0 < $intYandexExport) {
                 CAgent::AddAgent("CCatalog::PreGenerateXML(\"yandex\");", "catalog", "N", IntVal(COption::GetOptionString("catalog", "yandex_xml_period", "24")) * 60 * 60, "", "Y");
             }
         }
     }
     $ob = new CAutoSave();
     if (strlen($apply) <= 0) {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:iblock_edit.php

示例3: call_user_func_array

$arParams["USER_GROUPS"] = $GLOBALS["USER"]->GetUserGroupArray();
if (method_exists($arParams["DOCUMENT_TYPE"][1], "GetUserGroups")) {
    $arParams["USER_GROUPS"] = call_user_func_array(array($arParams["ENTITY"], "GetUserGroups"), array($documentType, $arParams["DOCUMENT_ID"], $GLOBALS["USER"]->GetID()));
}
if (empty($arError)) {
    if (!CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::CreateWorkflow, $GLOBALS["USER"]->GetID(), $documentType, array("UserGroups" => $arParams["USER_GROUPS"]))) {
        $arError[] = array("id" => "access_denied", "text" => GetMessage("BPATT_NO_PERMS"));
    }
}
if (!empty($arError)) {
    $e = new CAdminException($arError);
    ShowError($e->GetString());
    return false;
} elseif (!empty($_REQUEST['action']) && !check_bitrix_sessid()) {
} elseif ($_REQUEST['action'] == 'create_default') {
    CBPDocument::AddDefaultWorkflowTemplates($documentType);
    LocalRedirect($APPLICATION->GetCurPageParam("", array("action", "sessid")));
} elseif ($_REQUEST['ID'] <= 0) {
} elseif ($_REQUEST['action'] == 'delete') {
    $arErrorsTmp = array();
    CBPDocument::DeleteWorkflowTemplate($_REQUEST['ID'], $documentType, $arErrorsTmp);
    if (empty($arErrorsTmp)) {
        $url = !empty($_REQUEST["back_url"]) ? $_REQUEST["back_url"] : $APPLICATION->GetCurPageParam("", array("action", "sessid", "ID"));
        LocalRedirect($url);
    } elseif (!empty($arErrorsTmp)) {
        foreach ($arErrorsTmp as $e) {
            $arError[] = array("id" => "delete_error", "text" => $e["message"]);
        }
        $e = new CAdminException($arError);
        ShowError($e->GetString());
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


注:本文中的CBPDocument::AddDefaultWorkflowTemplates方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。