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


PHP CBPWorkflowTemplateLoader::update方法代码示例

本文整理汇总了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);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:36,代码来源:class.php

示例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);
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:36,代码来源:class.php


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