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


PHP CBPWorkflowTemplateLoader::getTemplatesList方法代码示例

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


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

示例1: GetMessage

     }
     if (!$canWrite) {
         $strError = GetMessage("CC_BLEE_ACCESS_DENIED_STATUS");
     }
     if (!$strError) {
         $arBizProcParametersValues = array();
         foreach ($arDocumentStates as $arDocumentState) {
             if (strlen($arDocumentState["ID"]) <= 0) {
                 $arErrorsTmp = array();
                 $arBizProcParametersValues[$arDocumentState["TEMPLATE_ID"]] = CBPDocument::StartWorkflowParametersValidate($arDocumentState["TEMPLATE_ID"], $arDocumentState["TEMPLATE_PARAMETERS"], $documentType, $arErrorsTmp);
                 foreach ($arErrorsTmp as $e) {
                     $strError .= $e["message"] . "<br />";
                 }
             }
         }
         $templateObject = CBPWorkflowTemplateLoader::getTemplatesList(array('ID' => 'DESC'), array('DOCUMENT_TYPE' => $documentType, 'AUTO_EXECUTE' => CBPDocumentEventType::Create), false, false, array('ID'));
         while ($template = $templateObject->fetch()) {
             if (!CBPWorkflowTemplateLoader::isConstantsTuned($template["ID"])) {
                 $strError .= GetMessage('CC_BLEE_IS_CONSTANTS_TUNED_NEW') . "<br />";
             }
         }
     }
 }
 if (!$strError) {
     $obElement = new CIBlockElement();
     if ($arResult["ELEMENT_ID"]) {
         $res = $obElement->Update($arResult["ELEMENT_ID"], $arElement, false, true, true);
         if (!$res) {
             $strError = $obElement->LAST_ERROR;
         }
     } else {
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:31,代码来源:component.php

示例2: processActionCheckDataElementCreation

 protected function processActionCheckDataElementCreation()
 {
     if ($_POST["save"] != "Y" && $_POST["changePostFormTab"] != "lists" && !check_bitrix_sessid()) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_IBLOCK'))));
     }
     if (!Loader::IncludeModule('bizproc')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_BIZPROC'))));
     }
     if (!Loader::includeModule('iblock')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_IBLOCK'))));
     }
     $this->iblockId = intval($this->request->getPost('IBLOCK_ID'));
     $this->iblockTypeId = COption::GetOptionString("lists", "livefeed_iblock_type_id");
     $this->checkPermissionElement();
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $templateId = intval($_POST['TEMPLATE_ID']);
     $documentType = BizprocDocument::generateDocumentComplexType(COption::GetOptionString("lists", "livefeed_iblock_type_id"), $this->iblockId);
     if (!empty($templateId)) {
         if (CModule::IncludeModule('bizproc')) {
             if (!CBPWorkflowTemplateLoader::isConstantsTuned($templateId)) {
                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_CONSTANTS_TUNED_NEW'))));
                 $this->sendJsonErrorResponse();
             }
         }
     } else {
         if (CModule::IncludeModule("bizproc")) {
             $templateObject = CBPWorkflowTemplateLoader::getTemplatesList(array('ID' => 'DESC'), array('DOCUMENT_TYPE' => $documentType, 'AUTO_EXECUTE' => CBPDocumentEventType::Create), false, false, array('ID'));
             $template = $templateObject->fetch();
             if (!empty($template)) {
                 if (!CBPWorkflowTemplateLoader::isConstantsTuned($template["ID"])) {
                     $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_CONSTANTS_TUNED_NEW'))));
                     $this->sendJsonErrorResponse();
                 }
             } else {
                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_NOT_BIZPROC_TEMPLATE'))));
                 $this->sendJsonErrorResponse();
             }
         }
     }
     $list = new CList($this->iblockId);
     $fields = $list->getFields();
     $elementData = array("IBLOCK_ID" => $this->iblockId, "NAME" => $_POST["NAME"]);
     $props = array();
     foreach ($fields as $fieldId => $field) {
         if ($fieldId == "PREVIEW_PICTURE" || $fieldId == "DETAIL_PICTURE") {
             $elementData[$fieldId] = $_FILES[$fieldId];
             if (isset($_POST[$fieldId . "_del"]) && $_POST[$fieldId . "_del"] == "Y") {
                 $elementData[$fieldId]["del"] = "Y";
             }
         } elseif ($fieldId == "PREVIEW_TEXT" || $fieldId == "DETAIL_TEXT") {
             if (isset($field["SETTINGS"]) && is_array($field["SETTINGS"]) && $field["SETTINGS"]["USE_EDITOR"] == "Y") {
                 $elementData[$fieldId . "_TYPE"] = "html";
             } else {
                 $elementData[$fieldId . "_TYPE"] = "text";
             }
             $elementData[$fieldId] = $_POST[$fieldId];
         } elseif ($fieldId == 'ACTIVE_FROM' || $fieldId == 'ACTIVE_TO') {
             $elementData[$fieldId] = array_shift($_POST[$fieldId]);
         } elseif ($list->is_field($fieldId)) {
             $elementData[$fieldId] = $_POST[$fieldId];
         } elseif ($field["PROPERTY_TYPE"] == "F") {
             if (isset($_POST[$fieldId . "_del"])) {
                 $deleteArray = $_POST[$fieldId . "_del"];
             } else {
                 $deleteArray = array();
             }
             $props[$field["ID"]] = array();
             $files = $this->unEscape($_FILES);
             CFile::ConvertFilesToPost($files[$fieldId], $props[$field["ID"]]);
             foreach ($props[$field["ID"]] as $fileId => $file) {
                 if (isset($deleteArray[$fileId]) && (!is_array($deleteArray[$fileId]) && $deleteArray[$fileId] == "Y" || is_array($deleteArray[$fileId]) && $deleteArray[$fileId]["VALUE"] == "Y")) {
                     if (isset($props[$field["ID"]][$fileId]["VALUE"])) {
                         $props[$field["ID"]][$fileId]["VALUE"]["del"] = "Y";
                     } else {
                         $props[$field["ID"]][$fileId]["del"] = "Y";
                     }
                 }
             }
         } elseif ($field["PROPERTY_TYPE"] == "N") {
             if (is_array($_POST[$fieldId]) && !array_key_exists("VALUE", $_POST[$fieldId])) {
                 $props[$field["ID"]] = array();
                 foreach ($_POST[$fieldId] as $key => $value) {
                     if (is_array($value)) {
                         if (strlen($value["VALUE"])) {
                             $value = str_replace(" ", "", str_replace(",", ".", $value["VALUE"]));
                             if (!is_numeric($value)) {
                                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_VALIDATE_FIELD_ERROR', array('#NAME#' => $field['NAME'])))));
                                 $this->sendJsonErrorResponse();
                             }
                             $props[$field["ID"]][$key] = doubleval($value);
                         }
                     } else {
                         if (strlen($value)) {
                             $value = str_replace(" ", "", str_replace(",", ".", $value));
                             if (!is_numeric($value)) {
                                 $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_IS_VALIDATE_FIELD_ERROR', array('#NAME#' => $field['NAME'])))));
                                 $this->sendJsonErrorResponse();
                             }
//.........这里部分代码省略.........
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:101,代码来源:ajax.php

示例3: processActionGetBizprocTemplateId

 protected function processActionGetBizprocTemplateId()
 {
     $this->checkRequiredPostParams(array('iblockId'));
     if (!Loader::includeModule('bizproc')) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_SEAC_CONNECTION_MODULE_BIZPROC'))));
     }
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $this->iblockId = intval($this->request->getPost('iblockId'));
     $this->checkPermission();
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $documentType = BizprocDocument::generateDocumentComplexType(COption::GetOptionString("lists", "livefeed_iblock_type_id"), $this->iblockId);
     $templateQuery = CBPWorkflowTemplateLoader::getTemplatesList(array('ID' => 'DESC'), array('DOCUMENT_TYPE' => $documentType, 'AUTO_EXECUTE' => CBPDocumentEventType::Create), false, false, array('ID', 'NAME'));
     $isAvailable = false;
     $templateData = array();
     while ($template = $templateQuery->fetch()) {
         $isAvailable = true;
         $templateData[$template['ID']]['ID'] = $template['ID'];
         $templateData[$template['ID']]['NAME'] = $template['NAME'];
     }
     if (!$isAvailable) {
         $this->errorCollection->add(array(new Error(Loc::getMessage('LISTS_NOT_BIZPROC_TEMPLATE_NEW'))));
     }
     if ($this->errorCollection->hasErrors()) {
         $this->sendJsonErrorResponse();
     }
     $manyTemplate = false;
     if (count($templateData) > 1) {
         $manyTemplate = true;
     }
     $this->sendJsonSuccessResponse(array('templateData' => $templateData, 'manyTemplate' => $manyTemplate));
 }
开发者ID:webgksupport,项目名称:alpina,代码行数:35,代码来源:ajax.php


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