本文整理汇总了PHP中CBPWorkflowTemplateLoader::update方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPWorkflowTemplateLoader::update方法的具体用法?PHP CBPWorkflowTemplateLoader::update怎么用?PHP CBPWorkflowTemplateLoader::update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPWorkflowTemplateLoader
的用法示例。
在下文中一共展示了CBPWorkflowTemplateLoader::update方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processActionSaveAjax
protected function processActionSaveAjax()
{
$this->request->addFilter(new PostDecodeFilter());
if ($this->request->getQuery('saveuserparams') == 'Y') {
$serializeValue = serialize($this->request->getPost('USER_PARAMS'));
if (strlen($serializeValue) > 64000) {
$response = "\n\t\t\t\t\t<script>\n\t\t\t\t\t\talert('" . Loc::getMessage('BIZPROC_USER_PARAMS_SAVE_ERROR') . "');\n\t\t\t\t\t</script>\n\t\t\t\t";
$this->sendResponse($response);
}
CUserOptions::setOption('~bizprocdesigner', 'activity_settings', $serializeValue);
$this->getApplication()->restartBuffer();
$this->end();
}
$fields = array('DOCUMENT_TYPE' => $this->arResult['DOCUMENT_COMPLEX_TYPE'], 'AUTO_EXECUTE' => $this->request->getPost('workflowTemplateAutostart'), 'NAME' => $this->request->getPost('workflowTemplateName'), 'DESCRIPTION' => $this->request->getPost('workflowTemplateDescription'), 'TEMPLATE' => $this->request->getPost('arWorkflowTemplate'), 'PARAMETERS' => $this->request->getPost('arWorkflowParameters'), 'VARIABLES' => $this->request->getPost('arWorkflowVariables'), 'CONSTANTS' => $this->request->getPost('arWorkflowConstants'), 'USER_ID' => intval($this->getUser()->getID()), 'MODIFIER_USER' => new CBPWorkflowTemplateUser(CBPWorkflowTemplateUser::CurrentUser));
if (!is_array($fields["VARIABLES"])) {
$fields['VARIABLES'] = array();
}
if (!is_array($fields["CONSTANTS"])) {
$fields['CONSTANTS'] = array();
}
if ($this->arResult['TEMPLATE'] != $fields['TEMPLATE']) {
$fields['SYSTEM_CODE'] = '';
}
try {
if ($this->arResult['ID'] > 0) {
CBPWorkflowTemplateLoader::update($this->arResult['ID'], $fields);
} else {
$this->arResult['ID'] = CBPWorkflowTemplateLoader::add($fields);
}
} catch (Exception $e) {
$response = "\n\t\t\t\t<script>\n\t\t\t\t\talert('" . Loc::getMessage('BIZPROC_WFEDIT_SAVE_ERROR') . "\\n " . preg_replace("#\\.\\W?#", ".\\n", AddSlashes(htmlspecialcharsbx($e->getMessage()))) . "');\n\t\t\t\t</script>\n\t\t\t";
$this->sendResponse($response);
}
$response = "\n\t\t\t<script>\n\t\t\t\twindow.location = '" . ($this->request->getQuery('apply') == 'Y' ? str_replace('#ID#', $this->arResult['ID'], $this->arResult['EDIT_PAGE_TEMPLATE']) : CUtil::JSEscape($this->arResult['LIST_PAGE_URL'])) . "';\n\t\t\t</script>\n\t\t";
$this->sendResponse($response);
}
示例2: processActionAutoload
protected function processActionAutoload()
{
$this->checkRequiredInputParams($_GET, array('action'));
if ($this->errorCollection->hasErrors()) {
$error = array_shift($this->getErrors());
throw new SystemException($error->getMessage());
}
$requestAction = $this->request->getQuery('action');
$requestBackUrl = $this->request->getQuery('back_url');
foreach ($this->arParams['DOCUMENT_DATA'] as $nameModule => $data) {
$result = CBPWorkflowTemplateLoader::getList(array('name' => 'asc'), array('DOCUMENT_TYPE' => $data['DOCUMENT_TYPE'], 'ID' => $this->request->getQuery('ID')), false, false, array('ID', 'NAME', 'AUTO_EXECUTE'));
if ($result && ($res = $result->fetch())) {
$fields = array('AUTO_EXECUTE' => $res['AUTO_EXECUTE']);
$temporary = false;
if (strpos($requestAction, 'create') !== false) {
$temporary = CBPDocumentEventType::Create;
} elseif (strpos($requestAction, 'edit') !== false) {
$temporary = CBPDocumentEventType::Edit;
} elseif (strpos($requestAction, 'delete') !== false) {
$temporary = CBPDocumentEventType::Delete;
}
if ($temporary != false) {
if (strpos($requestAction, 'present') !== false) {
$fields['AUTO_EXECUTE'] = ($fields['AUTO_EXECUTE'] & $temporary) != 0 ? $fields['AUTO_EXECUTE'] ^ $temporary : $fields['AUTO_EXECUTE'];
} else {
$fields['AUTO_EXECUTE'] = ($fields['AUTO_EXECUTE'] & $temporary) == 0 ? $fields['AUTO_EXECUTE'] ^ $temporary : $fields['AUTO_EXECUTE'];
}
}
if ($fields['AUTO_EXECUTE'] != $res['AUTO_EXECUTE']) {
CBPWorkflowTemplateLoader::update($this->request->getQuery('ID'), $fields);
}
}
}
$url = !empty($requestBackUrl) ? $requestBackUrl : $this->getApplication()->getCurPageParam('', array('action', 'sessid', 'ID'));
LocalRedirect($url);
}