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


PHP CBPWorkflowTemplateLoader::Update方法代码示例

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


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

示例1: GetMessage

		<script>
		alert('<?php 
        echo GetMessage("BIZPROC_WFEDIT_SAVE_ERROR");
        ?>
 <?php 
        echo AddSlashes(htmlspecialcharsbx($e->getMessage()));
        ?>
');
		</script>
		<?php 
        die;
    }
    set_exception_handler('wfeexception_handler');
    try {
        if ($ID > 0) {
            CBPWorkflowTemplateLoader::Update($ID, $arFields);
        } else {
            $ID = CBPWorkflowTemplateLoader::Add($arFields);
        }
    } catch (Exception $e) {
        wfeexception_handler($e);
    }
    restore_exception_handler();
    ?>
	<script type="text/javascript">
		window.location = '<?php 
    echo $_REQUEST["apply"] == "Y" ? Cutil::JSEscape("/bitrix/admin/" . MODULE_ID . "_bizproc_workflow_edit.php?lang=" . LANGUAGE_ID . "&entity=" . AddSlashes(ENTITY) . "&ID=" . $ID . "&back_url_list=" . urlencode($_REQUEST["back_url_list"])) : Cutil::JSEscape($back_url);
    ?>
';
	</script>
	<?php 
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:bizproc_workflow_edit.php

示例2: UpdateWorkflowTemplate

	/**
	* Метод изменяет параметры шаблона рабочего потока.
	*
	* @param int $id - код шаблона рабочего потока.
	* @param array $documentType - код типа документа в виде массива array(модуль, сущность, код_типа_документа_в_модуле).
	* @param array $arFields - массив новых значений параметров шаблона рабочего потока.
	* @param array $arErrors - массив ошибок, которые произошли при выполнении в виде array(array("code" => код_ошибки, "message" => сообщение, "file" => путь_к_файлу), ...).
	*/
	public static function UpdateWorkflowTemplate($id, $documentType, $arFields, &$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::Update($id, $arFields);
		}
		catch (Exception $e)
		{
			$arErrors[] = array(
				"code" => $e->getCode(),
				"message" => $e->getMessage(),
				"file" => $e->getFile()." [".$e->getLine()."]"
			);
		}
	}
开发者ID:ASDAFF,项目名称:bitrix-5,代码行数:43,代码来源:document.php

示例3: array_keys

                }
            }
        }
        $arKeys = array_keys($arResult["VARIABLES"]);
        foreach ($arKeys as $variableKey) {
            $arErrorsTmp = array();
            $arResult["VARIABLES"][$variableKey]["Default"] = $arResult["DocumentService"]->GetFieldInputValue($arResult["DOCUMENT_TYPE"], $arResult["VARIABLES"][$variableKey], $variableKey, $arRequest, $arErrorsTmp);
            $arResult["VARIABLES"][$variableKey]['Default_printable'] = $arResult["DocumentService"]->GetFieldInputValuePrintable($arResult["DOCUMENT_TYPE"], $arResult["VARIABLES"][$variableKey], $arResult["VARIABLES"][$variableKey]["Default"]);
            if (count($arErrorsTmp) > 0) {
                foreach ($arErrorsTmp as $e) {
                    $errorMessageTmp .= $e["message"];
                }
            }
        }
        if (strlen($errorMessageTmp) <= 0) {
            CBPWorkflowTemplateLoader::Update($arResult["ID"], array("VARIABLES" => $arResult["VARIABLES"]));
            if (strlen($_REQUEST["save_variables"]) > 0) {
                LocalRedirect(CComponentEngine::MakePathFromTemplate($arResult['LIST_PAGE_URL']));
            } else {
                LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["EDIT_PAGE_TEMPLATE"], array("ID" => $arResult["ID"])));
            }
        } else {
            $arResult["ErrorMessage"] .= $errorMessageTmp;
        }
    }
}
$this->IncludeComponentTemplate();
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
    if ($arParams["SET_TITLE"] == "Y") {
        $APPLICATION->SetTitle(str_replace("#NAME#", $arResult["NAME"], GetMessage("BPWC_WVC_PAGE_TITLE")));
    }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例4: elseif

            if (strpos($_REQUEST['action'], "create") !== false) {
                $tmp = CBPDocumentEventType::Create;
            } elseif (strpos($_REQUEST['action'], "edit") !== false) {
                $tmp = CBPDocumentEventType::Edit;
            } elseif (strpos($_REQUEST['action'], "delete") !== false) {
                $tmp = CBPDocumentEventType::Delete;
            }
            if ($tmp != false) {
                if (strpos($_REQUEST['action'], "_n") !== false) {
                    $arFields["AUTO_EXECUTE"] = ($arFields["AUTO_EXECUTE"] & $tmp) != 0 ? $arFields["AUTO_EXECUTE"] ^ $tmp : $arFields["AUTO_EXECUTE"];
                } else {
                    $arFields["AUTO_EXECUTE"] = ($arFields["AUTO_EXECUTE"] & $tmp) == 0 ? $arFields["AUTO_EXECUTE"] ^ $tmp : $arFields["AUTO_EXECUTE"];
                }
            }
            if ($arFields["AUTO_EXECUTE"] != $res["AUTO_EXECUTE"]) {
                CBPWorkflowTemplateLoader::Update($_REQUEST["ID"], $arFields);
            }
        }
    }
    $url = !empty($_REQUEST["back_url"]) ? $_REQUEST["back_url"] : $APPLICATION->GetCurPageParam("", array("action", "sessid", "ID"));
    LocalRedirect($url);
}
/********************************************************************
				Default falues
********************************************************************/
$arResult["NAV_STRING"] = "";
$arResult["NAV_RESULT"] = "";
$arResult["TEMPLATES"] = array();
$arResult["GRID_TEMPLATES"] = array();
/********************************************************************
				Data
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例5: foreach

     $arResult["CONSTANTS"][$variableKey]['Default_printable'] = $arResult["DocumentService"]->GetFieldInputValuePrintable($arResult["DOCUMENT_TYPE"], $arResult["CONSTANTS"][$variableKey], $arResult["CONSTANTS"][$variableKey]["Default"]);
     if (count($arErrorsTmp) > 0) {
         foreach ($arErrorsTmp as $e) {
             $errorMessageTmp .= GetMessage("BPWFSC_ARGUMENT_ERROR", array('#PARAM#' => $arResult["CONSTANTS"][$variableKey]['Name'], '#ERROR#' => $e["message"])) . ' ';
         }
     }
     if (empty($arErrorsTmp)) {
         $required = !(!$arResult["CONSTANTS"][$variableKey]['Required'] || is_int($arResult["CONSTANTS"][$variableKey]['Required']) && $arResult["CONSTANTS"][$variableKey]['Required'] == 0 || strtoupper($arResult["CONSTANTS"][$variableKey]['Required']) == "N");
         if ($required && (is_array($arResult["CONSTANTS"][$variableKey]["Default"]) && count($arResult["CONSTANTS"][$variableKey]["Default"]) <= 0 || !is_array($arResult["CONSTANTS"][$variableKey]["Default"]) && $arResult["CONSTANTS"][$variableKey]["Default"] === null)) {
             $errorMessageTmp .= GetMessage("BPWFSC_ARGUMENT_NULL", array('#PARAM#' => $arResult["CONSTANTS"][$variableKey]['Name'])) . ' ';
         }
     }
 }
 $errorMessageTmp = trim($errorMessageTmp);
 if (strlen($errorMessageTmp) <= 0) {
     CBPWorkflowTemplateLoader::Update($arResult["ID"], array("CONSTANTS" => $arResult["CONSTANTS"]));
     if ($arParams['AJAX_RESPONSE']) {
         $APPLICATION->RestartBuffer();
         echo CUtil::PhpToJSObject(array('SUCCESS' => true));
         CMain::FinalActions();
         die;
     }
     LocalRedirect($arResult['BackUrl']);
 } else {
     $arResult["ErrorMessage"] .= $errorMessageTmp;
     if ($arParams['AJAX_RESPONSE']) {
         $APPLICATION->RestartBuffer();
         echo CUtil::PhpToJSObject(array('ERROR_MESSAGE' => $arResult["ErrorMessage"]));
         CMain::FinalActions();
         die;
     }
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例6: array_keys

                    $arRequest[$k] = $v;
                }
            }
        }
        $arKeys = array_keys($arResult["WorkflowVariables"]);
        foreach ($arKeys as $variableKey) {
            $arErrorsTmp = array();
            $arResult["WorkflowVariables"][$variableKey]["Default"] = $arResult["DocumentService"]->GetFieldInputValue(array("bizproc", "CBPVirtualDocument", "type_" . $arResult["Block"]["ID"]), $arResult["WorkflowVariables"][$variableKey], $variableKey, $arRequest, $arErrorsTmp);
            if (count($arErrorsTmp) > 0) {
                foreach ($arErrorsTmp as $e) {
                    $errorMessageTmp .= $e["message"];
                }
            }
        }
        if (strlen($errorMessageTmp) <= 0) {
            CBPWorkflowTemplateLoader::Update($arResult["WorkflowTemplateId"], array("VARIABLES" => $arResult["WorkflowVariables"]));
            if (strlen($_REQUEST["save_variables"]) > 0) {
                LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LIST"], array("block_id" => $arResult["Block"]["ID"])));
            } else {
                LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_SETVAR"], array("block_id" => $arResult["Block"]["ID"])));
            }
        } else {
            $arResult["ErrorMessage"] .= $errorMessageTmp;
        }
    }
}
$this->IncludeComponentTemplate();
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
    if ($arParams["SET_TITLE"] == "Y") {
        $APPLICATION->SetTitle(str_replace("#NAME#", $arResult["BlockType"]["NAME"], GetMessage("BPWC_WVC_PAGE_TITLE")));
    }
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php


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