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


PHP CBPDocument::addShowParameterInit方法代码示例

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


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

示例1: getBizprocData

 protected function getBizprocData()
 {
     $userId = $this->getUser()->getID();
     $currentUserGroups = $this->getUser()->getUserGroupArray();
     if (!$this->lists['ELEMENT_FIELDS'] || $this->lists['ELEMENT_FIELDS']['CREATED_BY'] == $userId) {
         $currentUserGroups[] = 'Author';
     }
     $documentType = 'iblock_' . $this->iblockId;
     CBPDocument::addShowParameterInit('lists', 'only_users', $documentType);
     $this->lists['BIZPROC_FIELDS'] = array();
     $bizprocIndex = 0;
     $documentStates = CBPDocument::getDocumentStates(array('lists', 'BizprocDocument', $documentType), null);
     $runtime = CBPRuntime::getRuntime();
     $runtime->startRuntime();
     $documentService = $runtime->getService('DocumentService');
     foreach ($documentStates as $documentState) {
         $bizprocIndex++;
         $viewWorkflow = CBPDocument::CanUserOperateDocumentType(CBPCanUserOperateOperation::StartWorkflow, $userId, array('lists', 'BizprocDocument', $documentType), array('sectionId' => 0, 'AllUserGroups' => $currentUserGroups, 'DocumentStates' => $documentStates, 'WorkflowId' => $documentState['ID'] > 0 ? $documentState['ID'] : $documentState['TEMPLATE_ID']));
         if ($viewWorkflow) {
             $templateId = intval($documentState['TEMPLATE_ID']);
             $workflowParameters = $documentState['TEMPLATE_PARAMETERS'];
             if (!is_array($workflowParameters)) {
                 $workflowParameters = array();
             }
             if (strlen($documentState["ID"]) <= 0 && $templateId > 0) {
                 $parametersValues = array();
                 $keys = array_keys($workflowParameters);
                 foreach ($keys as $key) {
                     $value = $workflowParameters[$key]["Default"];
                     if (!is_array($value)) {
                         $parametersValues[$key] = htmlspecialcharsbx($value);
                     } else {
                         $keys1 = array_keys($value);
                         foreach ($keys1 as $key1) {
                             $parametersValues[$key][$key1] = htmlspecialcharsbx($value[$key1]);
                         }
                     }
                 }
                 foreach ($workflowParameters as $parameterKey => $arParameter) {
                     $parameterKeyExt = "bizproc" . $templateId . "_" . $parameterKey;
                     $html = $documentService->GetFieldInputControl(array('lists', 'BizprocDocument', $documentType), $arParameter, array("Form" => "start_workflow_form1", "Field" => $parameterKeyExt), $parametersValues[$parameterKey], false, true);
                     $this->lists['BIZPROC_FIELDS'][$parameterKeyExt . $bizprocIndex] = array("id" => $parameterKeyExt . $bizprocIndex, "required" => $arParameter["Required"], "name" => $arParameter["Name"], "title" => $arParameter["Description"], "type" => "custom", "value" => $html, 'show' => 'Y');
                 }
             }
         }
     }
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:47,代码来源:ajax.php


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