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


PHP CBPDocument::getTaskControls方法代码示例

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


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

示例1: htmlspecialcharsbx

$arResult['WORKFLOW_TEMPLATE_NAME'] = $arState["TEMPLATE_NAME"];
$runtime = CBPRuntime::GetRuntime();
$runtime->StartRuntime();
$documentService = $runtime->GetService("DocumentService");
$arResult['DOCUMENT_ICON'] = $documentService->getDocumentIcon($arResult['TASK']['PARAMETERS']['DOCUMENT_ID']);
if (empty($arResult['TASK']['DOCUMENT_NAME'])) {
    $arResult['TASK']['DOCUMENT_NAME'] = htmlspecialcharsbx($documentService->getDocumentName($arResult['TASK']['PARAMETERS']['DOCUMENT_ID']));
}
if ($arResult["ShowMode"] != "Success") {
    try {
        $documentType = $documentService->GetDocumentType($arResult["TASK"]["PARAMETERS"]["DOCUMENT_ID"]);
        if (!array_key_exists("BP_AddShowParameterInit_" . $documentType[0] . "_" . $documentType[1] . "_" . $documentType[2], $GLOBALS)) {
            $GLOBALS["BP_AddShowParameterInit_" . $documentType[0] . "_" . $documentType[1] . "_" . $documentType[2]] = 1;
            CBPDocument::AddShowParameterInit($documentType[0], "only_users", $documentType[2], $documentType[1]);
        }
        // deprecated old style
        list($arResult["TaskForm"], $arResult["TaskFormButtons"]) = CBPDocument::ShowTaskForm($arResult["TASK"], $arParams["USER_ID"], "", $_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "doTask" ? $_REQUEST : null);
        // new style
        $arResult['TaskControls'] = CBPDocument::getTaskControls($arResult["TASK"]);
    } catch (Exception $e) {
        ShowError(GetMessage("BPAT_NO_ACCESS"));
        return false;
    }
}
$this->IncludeComponentTemplate();
if ($arParams["SET_TITLE"] == "Y") {
    $APPLICATION->SetTitle(GetMessage("BPAT_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] == "Y") {
    $APPLICATION->AddChainItem(GetMessage("BPAT_TITLE"));
}
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php

示例2: switch

 $record['data']["NAME"] = '<span class="bp-task"><a href="#" onclick="' . $popupJs . '" title="' . $record['data']["NAME"] . '">' . $record['data']["NAME"] . '</a></span>';
 if ($record['data']['IS_MY']) {
     if ($record['data']['USER_STATUS'] > CBPTaskUserStatus::Waiting) {
         switch ($record['data']['USER_STATUS']) {
             case CBPTaskUserStatus::Yes:
                 $record['data']["NAME"] .= '<span class="bp-status-ready">' . GetMessage('BPATL_USER_STATUS_YES') . '</span>';
                 break;
             case CBPTaskUserStatus::No:
                 $record['data']["NAME"] .= '<span class="bp-status-cancel">' . GetMessage('BPATL_USER_STATUS_NO') . '</span>';
                 break;
             default:
                 $record['data']["NAME"] .= '<span class="bp-status-ready">' . GetMessage('BPATL_USER_STATUS_OK') . '</span>';
         }
     } elseif ($record['data']['IS_INLINE'] == 'Y') {
         $record['data']["NAME"] .= '<div class="bp-btn-panel">';
         $controls = CBPDocument::getTaskControls($record['data']);
         foreach ($controls['BUTTONS'] as $control) {
             $class = $control['TARGET_USER_STATUS'] == CBPTaskUserStatus::No ? 'decline' : 'accept';
             $props = CUtil::PhpToJSObject(array('TASK_ID' => $record['data']['ID'], $control['NAME'] => $control['VALUE']));
             $record['data']["NAME"] .= '<a href="#" onclick="return BX.Bizproc.doInlineTask(' . $props . ', function(){window[\'bxGrid_' . $arResult["GRID_ID"] . '\'].Reload()}, this)" class="bp-button bp-button bp-button-' . $class . '"><span class="bp-button-icon"></span><span class="bp-button-text">' . $control['TEXT'] . '</span></a>';
         }
         $record['data']["NAME"] .= '</div>';
     } else {
         $anchor = '<a href="#" class="bp-button bp-button bp-button-blue" onclick="' . $popupJs . '">' . GetMessage("BPATL_BEGIN") . '</a>';
         // @TODO: support RequestInformationActivity in popup mode
         if ($record['data']['ACTIVITY'] == 'RequestInformationActivity') {
             $anchor = '<a href="' . $record['data']['URL']['TASK'] . '" class="bp-button bp-button bp-button-blue">' . GetMessage("BPATL_BEGIN") . '</a>';
         }
         $record['data']["NAME"] .= '<div class="bp-btn-panel">' . $anchor . '</div>';
     }
 } else {
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:template.php

示例3: empty

}
if (!CModule::IncludeModule('bizproc')) {
    return false;
}
if (!$GLOBALS['USER']->IsAuthorized()) {
    return false;
}
$arParams['WORKFLOW_ID'] = empty($arParams['WORKFLOW_ID']) ? $_REQUEST['WORKFLOW_ID'] : $arParams['WORKFLOW_ID'];
if (!$arParams['WORKFLOW_ID']) {
    return false;
}
$arResult['TASKS'] = CBPViewHelper::getWorkflowTasks($arParams['WORKFLOW_ID'], true, true);
$arResult['WORKFLOW_STATE_INFO'] = CBPStateService::getWorkflowStateInfo($arParams['WORKFLOW_ID']);
$arResult['USER_ID'] = (int) $GLOBALS['USER']->GetId();
if (!empty($arResult['TASKS']['RUNNING'])) {
    foreach ($arResult['TASKS']['RUNNING'] as &$t) {
        if ($t['IS_INLINE'] == 'Y') {
            $controls = CBPDocument::getTaskControls($t);
            $t['BUTTONS'] = $controls['BUTTONS'];
        }
        if (isset($t['PARAMETERS']['AccessControl']) && $t['PARAMETERS']['AccessControl'] == 'Y') {
            $t['DESCRIPTION'] = '';
        }
    }
}
$arResult['noWrap'] = isset($arParams['NOWRAP']) && $arParams['NOWRAP'] == 'Y';
ob_start();
$this->IncludeComponentTemplate();
$message = ob_get_contents();
ob_end_clean();
return array('MESSAGE' => $arResult['noWrap'] ? $message : htmlspecialcharsEx($message), 'CACHED_JS_PATH' => '/bitrix/js/bizproc/tools.js', "CACHED_CSS_PATH" => array($this->getTemplate()->GetFolder() . "/style.css", '/bitrix/components/bitrix/bizproc.workflow.faces/templates/.default/style.css'));
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


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