本文整理汇总了PHP中CBPDocument::GetUserTasksForWorkflow方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::GetUserTasksForWorkflow方法的具体用法?PHP CBPDocument::GetUserTasksForWorkflow怎么用?PHP CBPDocument::GetUserTasksForWorkflow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPDocument
的用法示例。
在下文中一共展示了CBPDocument::GetUserTasksForWorkflow方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
</td>
</tr>
</table>
</li>
<?php
}
foreach ($arDocumentStates as $arDocumentState) {
$bizProcIndex++;
if (intVal($arDocumentState["WORKFLOW_STATUS"]) < 0 || $arDocumentState["ID"] <= 0) {
continue;
} elseif (!CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $arParams["DOCUMENT_ID"], array("DocumentStates" => $arDocumentStates, "WorkflowId" => $arDocumentState["ID"]))) {
continue;
}
$arTasks = array();
$arDumpWorkflow = array();
$arTasks = CBPDocument::GetUserTasksForWorkflow($USER->GetID(), $arDocumentState["ID"]);
if (strlen($arDocumentState["WORKFLOW_STATUS"]) > 0) {
$arDmpWorkflow = array_reverse(CBPTrackingService::DumpWorkflow($arDocumentState["ID"]));
$track = $tmp = reset($arDmpWorkflow);
do {
$strMessageTemplate = "";
switch ($track["TYPE"]) {
case 1:
$strMessageTemplate = GetMessage("BPABL_TYPE_1");
break;
case 2:
$strMessageTemplate = GetMessage("BPABL_TYPE_2");
break;
case 3:
$strMessageTemplate = GetMessage("BPABL_TYPE_3");
break;
示例2: __build_item_info
//.........这里部分代码省略.........
$aCols["NAME"]['status'] = '';
if ($arParams["PERMISSION"] >= "U" && in_array($res['LOCK_STATUS'], array("red", "yellow"))) {
$aCols["NAME"]['status'] .= '<div class="element-status-' . $res['LOCK_STATUS'] . '">';
if ($res['LOCK_STATUS'] == "yellow") {
$aCols["NAME"]['status'] .= '[' . GetMessage("IBLOCK_YELLOW_MSG") . ']';
} else {
if (!is_array($res['WF_LOCKED_BY']) && intval($res['WF_LOCKED_BY']) > 0) {
$rUserLockedBy = CUser::GetByID($res['WF_LOCKED_BY']);
$res['WF_LOCKED_BY'] = $rUserLockedBy->Fetch();
}
if (isset($res['WF_LOCKED_BY']['ID']) && $res['WF_LOCKED_BY']['ID'] > 0) {
$res['LOCKED_USER_NAME'] = CUser::FormatName($nameTemplate, $res['WF_LOCKED_BY']);
$aCols["NAME"]['status'] .= '[' . trim(GetMessage("IBLOCK_RED_MSG", array('#NAME#' => $res['LOCKED_USER_NAME']))) . ']';
} else {
$aCols["NAME"]['status'] .= '[' . GetMessage("IBLOCK_RED_MSG_OTHER") . ']';
}
}
$aCols["NAME"]['status'] .= '</div>';
}
if ($arParams["USE_COMMENTS"] == "Y" && intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) > 0) {
$aCols["NAME"]['comments'] = '<a href="' . $res["URL"]["VIEW"] . '?webdavForm' . $arParams["IBLOCK_ID"] . '_active_tab=tab_comments" class="element-properties element-comments" title="' . GetMessage("WD_COMMENTS_FOR_DOCUMENT") . " " . intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) . '">' . intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) . '</a>';
}
$aCols["PROPERTY_FORUM_MESSAGE_CNT"] = '<a href="' . $res["URL"]["VIEW"] . '">' . intVal($res["PROPERTY_FORUM_MESSAGE_CNT_VALUE"]) . '</a>';
$aCols["BP_PUBLISHED"] = "<div class=\"wd-bp-published wd-bp-published-" . ($res["BP_PUBLISHED"] != "Y" ? "n" : "y") . "\"></div>";
$aCols["NAME"]["version"] = "";
if ($arParams["WORKFLOW"] == "bizproc" && $res["WF_PARENT_ELEMENT_ID"] > 0) {
$aCols["NAME"]["version"] = "<span class=\"wd-element-version\">" . GetMessage("WD_NAME_VERSION") . "</span>";
}
$aCols["BIZPROC"] = "";
if ($arParams["WORKFLOW"] == "bizproc" && !empty($res["arDocumentStates"])) {
$arDocumentStates = $res["arDocumentStates"];
if (count($arDocumentStates) == 1) {
$arDocumentState = reset($arDocumentStates);
$arTasksWorkflow = CBPDocument::GetUserTasksForWorkflow($GLOBALS["USER"]->GetID(), $arDocumentState["ID"]);
$aColss["BIZPROC"] = '<div class="bizproc-item-title">' . (!empty($arDocumentState["TEMPLATE_NAME"]) ? htmlspecialcharsbx(htmlspecialcharsbx($arDocumentState["TEMPLATE_NAME"])) : GetMessage("IBLIST_BP")) . ': ' . '<span class="bizproc-item-title bizproc-state-title" style="">' . '<a href="' . $res["URL"]["BP"] . '">' . (strlen($arDocumentState["STATE_TITLE"]) > 0 ? htmlspecialcharsbx(htmlspecialcharsbx($arDocumentState["STATE_TITLE"])) : htmlspecialcharsbx(htmlspecialcharsbx($arDocumentState["STATE_NAME"]))) . '</a>' . '</span>' . '</div>';
$aColss["BIZPROC"] = str_replace("'", "\"", $aColss["BIZPROC"]);
$aCols["NAME"]['bizproc'] = "<div class=\"element-bizproc-status bizproc-statuses " . (!(strlen($arDocumentState["ID"]) <= 0 || strlen($arDocumentState["WORKFLOW_STATUS"]) <= 0) ? 'bizproc-status-' . (empty($arTasksWorkflow) ? "inprogress" : "attention") : '') . "\" onmouseover='BX.hint(this, \"" . addslashes($aColss["BIZPROC"]) . "\")'></div>";
if (!empty($arTasksWorkflow)) {
$tmp = array();
foreach ($arTasksWorkflow as $key => $val) {
$url = CComponentEngine::MakePathFromTemplate($arParams["WEBDAV_TASK_URL"], array("ELEMENT_ID" => $res["ID"], "ID" => $val["ID"]));
$url = WDAddPageParams($url, array("back_url" => urlencode($GLOBALS['APPLICATION']->GetCurPageParam())), false);
$tmp[] = '<a href="' . $url . '">' . $val["NAME"] . '</a>';
}
$aColss["BIZPROC"] .= '<div class="bizproc-tasks">' . implode(", ", $tmp) . '</div>';
}
} else {
$arTasks = array();
$bInprogress = false;
$tmp = array();
foreach ($arDocumentStates as $key => $arDocumentState) {
$arTasksWorkflow = CBPDocument::GetUserTasksForWorkflow($GLOBALS["USER"]->GetID(), $arDocumentState["ID"]);
if (!$bInprogress) {
$bInprogress = strlen($arDocumentState["ID"]) > 0 && strlen($arDocumentState["WORKFLOW_STATUS"]) > 0;
}
$tmp[$key] = '<li class="bizproc-item">' . '<div class="bizproc-item-title">' . '<div class="bizproc-statuses ' . (strlen($arDocumentState["ID"]) > 0 && strlen($arDocumentState["WORKFLOW_STATUS"]) > 0 ? 'bizproc-status-' . (empty($arTasksWorkflow) ? "inprogress" : "attention") : '') . '"></div>' . (!empty($arDocumentState["TEMPLATE_NAME"]) ? $arDocumentState["TEMPLATE_NAME"] : GetMessage("IBLIST_BP")) . '</div>' . '<div class="bizproc-item-title bizproc-state-title">' . (strlen($arDocumentState["STATE_TITLE"]) > 0 ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"]) . '</div>';
if (!empty($arTasksWorkflow)) {
$tmp_tasks = array();
foreach ($arTasksWorkflow as $val) {
$url = CComponentEngine::MakePathFromTemplate($arParams["WEBDAV_TASK_URL"], array("ELEMENT_ID" => $res["ID"], "ID" => $val["ID"]));
$url = WDAddPageParams($url, array("back_url" => urlencode($GLOBALS['APPLICATION']->GetCurPageParam())), false);
$tmp_tasks[] = '<a href="' . $url . '">' . $val["NAME"] . '</a>';
$arTasks[] = $val;
}
$tmp[$key] .= '<div class="bizproc-tasks">' . implode(", ", $tmp_tasks) . '</div>';
}
示例3: array
$arCurrentUserGroups[] = "author";
}
$documentId = array("bizproc", "CBPVirtualDocument", $arResult["BP"]["ID"]);
$arDocumentStates = CBPDocument::GetDocumentStates($documentType, $documentId);
foreach ($arDocumentStates as $arDocumentState) {
$arResult["BP"]["DOCUMENT_STATE"] = $arDocumentState;
$ar = CBPDocument::GetAllowableEvents($GLOBALS["USER"]->GetID(), $arCurrentUserGroups, $arDocumentState);
foreach ($ar as $ar1) {
$ar1["URL"] = $APPLICATION->GetCurPageParam("bizproc_id=" . $arDocumentState["ID"] . "&process_state_event=Y&bizproc_event=" . htmlspecialcharsbx($ar1["NAME"]) . "&" . bitrix_sessid_get(), array("sessid", "stop_bizproc_id", "process_state_event", "bizproc_event", "bizproc_id"));
$arResult["BP"]["DOCUMENT_STATE_EVENTS"][] = $ar1;
}
if (count($arResult["BP"]["DOCUMENT_STATE_EVENTS"]) > 0) {
$arResult["ShowStateEvents"] = true;
}
$arResult["BP"]["DOCUMENT_STATE_TASKS"] = array();
$ar = CBPDocument::GetUserTasksForWorkflow($GLOBALS["USER"]->GetID(), $arDocumentState["ID"]);
foreach ($ar as $ar1) {
$ar1["URL"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_TASK"], array("task_id" => $ar1["ID"], "block_id" => $arParams["BLOCK_ID"]));
$arResult["BP"]["DOCUMENT_STATE_TASKS"][] = $ar1;
}
if (count($arResult["BP"]["DOCUMENT_STATE_TASKS"]) > 0) {
$arResult["ShowTasks"] = true;
}
$arResult["BP"]["CancelUrl"] = "";
if ($arResult["AllowAdmin"] && strlen($arDocumentState["ID"]) > 0 && strlen($arDocumentState["WORKFLOW_STATUS"]) > 0) {
$arResult["BP"]["CancelUrl"] = $APPLICATION->GetCurPageParam("stop_bizproc_id=" . $arDocumentState["ID"] . "&" . bitrix_sessid_get(), array("sessid", "stop_bizproc_id"));
}
}
}
$this->IncludeComponentTemplate();
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
示例4: elseif
} elseif ($arParams["WORKFLOW"] == 'bizproc') {
$aCols["WF_STATUS_ID"] = $res["WF_STATUS_ID"] == 2 ? GetMessage("WD_STATUS_NOT_PUBLISHED") : GetMessage("WD_STATUS_PUBLISHED");
} else {
$aCols["WF_STATUS_ID"] = GetMessage("WD_STATUS_PUBLISHED");
}
$aCols["LOCK_STATUS"] = '<div class="element-lamp-' . $res["LOCK_STATUS"] . '" title="' . ($res["LOCK_STATUS"] == "green" ? GetMessage("IBLOCK_GREEN_ALT") : ($res["LOCK_STATUS"] == "yellow" ? GetMessage("IBLOCK_YELLOW_ALT") : GetMessage("IBLOCK_RED_ALT"))) . '"></div>' . ($res['LOCK_STATUS'] == 'red' && $res['LOCKED_USER_NAME'] != '' ? $aCols['LOCKED_USER_NAME'] : '');
$arChildren = array();
if (!$bDialog && $arParams["WORKFLOW"] == "bizproc" && !empty($res["CHILDREN"])) {
foreach ($res["CHILDREN"] as $k => $rs) {
$arBProcesses = $arFlags = array();
if (is_array($rs["arDocumentStates"]) && !empty($rs["arDocumentStates"])) {
foreach ($rs["arDocumentStates"] as $key => $arDocumentState) {
if (!(strlen($arDocumentState["ID"]) > 0 && strlen($arDocumentState["WORKFLOW_STATUS"]) > 0)) {
continue;
}
$arTasksWorkflow = CBPDocument::GetUserTasksForWorkflow($currentUserID, $arDocumentState["ID"]);
$bTasks = !empty($arTasksWorkflow);
$arFlags["tasks"] = $arFlags["tasks"] == true ? true : $bTasks;
$arFlags["inprogress"]++;
$arBProcesses[] = '<div class="bizproc-item-title">' . '<div class="bizproc-statuses bizproc-status-' . ($bTasks ? "attention" : "inprogress") . '"></div>' . (!empty($arDocumentState["TEMPLATE_NAME"]) ? $arDocumentState["TEMPLATE_NAME"] : GetMessage("IBLIST_BP")) . ': ' . '<span class="bizproc-item-title bizproc-state-title" style="margin-left:1em;">' . '<a href="' . WDAddPageParams(CComponentEngine::MakePathFromTemplate($arParams["~ELEMENT_URL"], array("ELEMENT_ID" => $rs["ID"], "ACTION" => "EDIT")), array("webdavForm" . $arParams["IBLOCK_ID"] . "_active_tab" => "tab_bizproc_view")) . '">' . ($arDocumentState["STATE_TITLE"] ? $arDocumentState["STATE_TITLE"] : $arDocumentState["STATE_NAME"]) . '</a>' . '</span>' . '</div>';
}
}
foreach (array("MODIFIED_BY") as $user_key) {
$rs[$user_key] = is_array($rs[$user_key]) ? $rs[$user_key] : __parse_user($rs[$user_key], $arParams["USER_VIEW_URL"]);
$rs[$user_key] = $rs[$user_key]["LINK"];
}
$tmp = '<div class="bizproc-item-title">' . '<div class="bizproc-statuses"></div>' . '<span class="bizproc-item-title bizproc-state-title">' . '<a href="' . CComponentEngine::MakePathFromTemplate($arParams["~ELEMENT_URL"], array("ELEMENT_ID" => $rs["ID"], "ACTION" => "EDIT")) . '">' . str_replace("'", "'", htmlspecialcharsbx($rs["NAME"])) . '</a> (' . $rs["MODIFIED_BY"] . ')' . '</span>' . '</div>';
if (!empty($arBProcesses)) {
$tmp = '<div class="bizproc-item-title">' . '<div class="bizproc-statuses bizproc-status-' . ($arFlags["tasks"] ? "attention" : "inprogress") . '"></div>' . '<span class="bizproc-item-title bizproc-state-title">' . '<a href="' . CComponentEngine::MakePathFromTemplate($arParams["~ELEMENT_URL"], array("ELEMENT_ID" => $rs["ID"], "ACTION" => "EDIT")) . '">' . str_replace("'", "'", htmlspecialcharsbx($rs["NAME"])) . '</a> (' . $rs["MODIFIED_BY"] . ')' . '</span>' . '<img src="/bitrix/images/1.gif" onload="WDTooltip' . $rs['ID'] . '(this)" />' . '</div>';
echo '<script>
function WDTooltip' . $rs['ID'] . '(elm) {