Ejemplo n.º 1
0
    if (!empty($arParams["WORKFLOW_ID"])) {
        $arFilter["WORKFLOW_ID"] = $arParams["WORKFLOW_ID"];
    }
    $runtime = CBPRuntime::GetRuntime();
    $runtime->StartRuntime();
    $documentService = $runtime->GetService("DocumentService");
    $dbRecordsList = CBPTrackingService::GetList($hgridSort["sort"], $arFilter);
    while ($arRecord = $dbRecordsList->GetNext()) {
        if (strlen($arRecord["WORKFLOW_ID"]) > 0) {
            $arRecord["STATE"] = CBPStateService::GetWorkflowState($arRecord["WORKFLOW_ID"]);
            $arRecord["DOCUMENT_URL"] = CBPDocument::GetDocumentAdminPage($arRecord["STATE"]["DOCUMENT_ID"]);
            try {
                $dt = $documentService->GetDocumentType($arRecord["STATE"]["DOCUMENT_ID"]);
            } catch (Exception $e) {
            }
            $arRecord["ACTION_NOTE"] = CBPTrackingService::parseStringParameter($arRecord["ACTION_NOTE"], $dt);
        }
        $aActions = array();
        if (strlen($arRecord["DOCUMENT_URL"]) > 0) {
            $aActions[] = array("ICONCLASS" => "", "DEFAULT" => false, "TEXT" => GetMessage("BPTL_C_DOCUMENT"), "ONCLICK" => "window.open('" . $arRecord["DOCUMENT_URL"] . "');");
        }
        $arResult["H_RECORDS"][] = array("data" => $arRecord, "actions" => $aActions, "columns" => array(), "editable" => false);
    }
    $arResult["H_ROWS_COUNT"] = $dbRecordsList->SelectedRowsCount();
    $arResult["H_NAV_STRING"] = $dbRecordsList->GetPageNavStringEx($navComponentObject, GetMessage("INTS_TASKS_NAV"), "", false);
    $arResult["H_NAV_CACHED_DATA"] = $navComponentObject->GetTemplateCachedData();
    $arResult["H_NAV_RESULT"] = $dbRecordsList;
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
    if (!$arParams['COUNTERS_ONLY']) {
        if ($arParams["SET_TITLE"] == "Y") {
Ejemplo n.º 2
0
                    $result = GetMessage("BPABL_RES_4");
                    break;
                case CBPActivityExecutionResult::Uninitialized:
                    $result = GetMessage("BPABL_RES_5");
                    break;
                default:
                    $status = GetMessage("BPABL_RES_6");
            }
            $note = strlen($track["ACTION_NOTE"]) > 0 ? ": " . $track["ACTION_NOTE"] : "";
            $note = CBPTrackingService::parseStringParameter($note);
            echo str_replace(array("#ACTIVITY#", "#STATUS#", "#RESULT#", "#NOTE#"), array($name, $status, $result, $note), $strMessageTemplate);
            echo "<br />";
        }
        echo "<br><a href='" . htmlspecialcharsbx($APPLICATION->GetCurPageParam("admin_mode=N", array("admin_mode"))) . "'>" . GetMessage("BPABL_RES2SIMPLEMODE") . "</a>";
    } else {
        $dbResult = CBPTrackingService::GetList(array("ID" => "ASC"), array("WORKFLOW_ID" => $ID, "TYPE" => array(CBPTrackingType::Report, CBPTrackingType::Custom, CBPTrackingType::FaultActivity)), false, false, array("ID", "MODIFIED", "ACTION_NOTE"));
        while ($arResult = $dbResult->GetNext()) {
            echo "<i>" . $arResult["MODIFIED"] . "</i><br>" . CBPTrackingService::parseStringParameter($arResult["ACTION_NOTE"]) . "<br><br>";
        }
        echo "<a href='" . htmlspecialcharsbx($APPLICATION->GetCurPageParam("admin_mode=Y", array("admin_mode"))) . "'>" . GetMessage("BPABL_RES2ADMINMODE") . "</a>";
    }
    ?>
			</td>
		</tr>
	<?php 
    //$tabControl->Buttons();
    ?>
	<?php 
    $tabControl->End();
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
Ejemplo n.º 3
0
                 $result = GetMessage("BPABL_RES_2");
                 break;
             case CBPActivityExecutionResult::Canceled:
                 $result = GetMessage("BPABL_RES_3");
                 break;
             case CBPActivityExecutionResult::Faulted:
                 $result = GetMessage("BPABL_RES_4");
                 break;
             case CBPActivityExecutionResult::Uninitialized:
                 $result = GetMessage("BPABL_RES_5");
                 break;
             default:
                 $result = GetMessage("BPABL_RES_6");
         }
         $note = $arTrack["ACTION_NOTE"];
         $note = CBPTrackingService::parseStringParameter($note, $documentType);
         $modified_by = "";
         if (intval($arTrack["MODIFIED_BY"]) > 0) {
             $dbUserTmp = CUser::GetByID($arTrack["MODIFIED_BY"]);
             $arUserTmp = $dbUserTmp->GetNext();
             $modified_by = CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, true, false);
             $modified_by .= " [" . $arTrack["MODIFIED_BY"] . "]";
         }
         $aCols = array("date" => $date, "name" => $name, "type" => $type, "status" => $status, "result" => $result, "note" => $note, "modified_by" => $modified_by);
         $aActions = array();
         $arResult["RECORDS"][] = array("data" => $arTrack, "actions" => $aActions, "columns" => $aCols, "editable" => false);
     }
 }
 if (strlen($arResult["FatalErrorMessage"]) <= 0) {
     if ($arParams["SET_TITLE"] == "Y") {
         $APPLICATION->SetTitle(GetMessage("BPABL_PAGE_TITLE") . ": " . $arResult["WorkflowState"]["TEMPLATE_NAME"]);
Ejemplo n.º 4
0
            case CBPActivityExecutionResult::Succeeded:
                $result = GetMessage("BPABL_RES_2");
                break;
            case CBPActivityExecutionResult::Canceled:
                $result = GetMessage("BPABL_RES_3");
                break;
            case CBPActivityExecutionResult::Faulted:
                $result = GetMessage("BPABL_RES_4");
                break;
            case CBPActivityExecutionResult::Uninitialized:
                $result = GetMessage("BPABL_RES_5");
                break;
            default:
                $status = GetMessage("BPABL_RES_6");
        }
        $note = CBPTrackingService::parseStringParameter($arTrack["ACTION_NOTE"], $documentType);
        $modified_by = "";
        if (intval($arTrack["MODIFIED_BY"]) > 0) {
            $dbUserTmp = CUser::GetByID($arTrack["MODIFIED_BY"]);
            $arUserTmp = $dbUserTmp->GetNext();
            $modified_by = CUser::FormatName($arParams["NAME_TEMPLATE"], $arUserTmp, true);
            $modified_by .= " [" . $arTrack["MODIFIED_BY"] . "]";
        }
        $aCols = array("date" => $date, "name" => $name, "type" => $type, "status" => $status, "result" => $result, "note" => $note, "modified_by" => $modified_by);
        $aActions = array();
        $arResult["RECORDS"][] = array("data" => $arTrack, "actions" => $aActions, "columns" => $aCols, "editable" => false);
    }
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
    if ($arParams["SET_TITLE"] == "Y") {
        $APPLICATION->SetTitle(GetMessage("BPABL_PAGE_TITLE") . ": " . $arResult["BP"]["NAME"]);
Ejemplo n.º 5
0
    $arResultGrid["GRID_ID"] = "form_bp_grid_" . implode("_", $arResult["DocumentType"]);
    $gridOptions = new CGridOptions($arResultGrid["GRID_ID"]);
    $arSort = $gridOptions->GetSorting(array("sort" => array("id" => "desc"), "vars" => array("by" => "by", "order" => "order")));
    $arNav = $gridOptions->GetNavParams(array("nPageSize" => 20));
    $arSortArg = each($arSort["sort"]);
    $dbTrack = CBPTrackingService::GetList($arSort["sort"], array("WORKFLOW_ID" => $arResult["BP"]["DOCUMENT_STATE"]["ID"], "TYPE" => array(CBPTrackingType::Custom, CBPTrackingType::FaultActivity, CBPTrackingType::Report)));
    $dbTrack->NavStart($arNav["nPageSize"]);
    $arRowsTmp = array();
    while ($arTrackRecord = $dbTrack->GetNext()) {
        foreach ($arTrackRecord as $key => $value) {
            if ($key != 'ACTION_NOTE' && CheckDateTime($value)) {
                $arTrackRecord[$key] = FormatDateFromDB($value);
            }
        }
        $note = $arTrackRecord["ACTION_NOTE"];
        $note = CBPTrackingService::parseStringParameter($note, $arResult["DocumentType"]);
        $arCols = array("ACTION_NOTE" => $note);
        $arRowsTmp[] = array("data" => $arTrackRecord, "actions" => array(), "columns" => $arCols, "editable" => false);
    }
    $arResultGrid["ROWS"] = $arRowsTmp;
    $arResultGrid["ROWS_COUNT"] = $dbTrack->SelectedRowsCount();
    $arResultGrid["SORT"] = $arSort["sort"];
    $arResultGrid["SORT_VARS"] = $arSort["vars"];
    $dbTrack->bShowAll = false;
    $arResultGrid["NAV_OBJECT"] = $dbTrack;
    ob_start();
    $APPLICATION->IncludeComponent("bitrix:main.interface.grid", "", array("GRID_ID" => $arResultGrid["GRID_ID"], "HEADERS" => array(array("id" => "MODIFIED", "name" => GetMessage("BPWC_WNCT_TL_DATE"), "sort" => "MODIFIED", "default" => true, "editable" => false), array("id" => "ACTION_TITLE", "name" => GetMessage("BPWC_WNCT_TL_NAME"), "default" => true, "editable" => false), array("id" => "ACTION_NOTE", "name" => GetMessage("BPWC_WNCT_TL_NOTE"), "default" => true, "editable" => false)), "SORT" => $arResultGrid["SORT"], "SORT_VARS" => $arResultGrid["SORT_VARS"], "ROWS" => $arResultGrid["ROWS"], "FOOTER" => array(array("title" => GetMessage("BPWC_WNCT_TL_TOTAL"), "value" => $arResultGrid["ROWS_COUNT"])), "ACTIONS" => array(), "ACTION_ALL_ROWS" => false, "EDITABLE" => false, "NAV_OBJECT" => $arResultGrid["NAV_OBJECT"], "AJAX_MODE" => "N", "AJAX_OPTION_JUMP" => "N", "AJAX_OPTION_STYLE" => "Y", "FORM_ID" => $arResult["FORM_ID"], "TAB_ID" => "tab3"), $component);
    $gridTmp = ob_get_clean();
    $arTabs[] = array("id" => "tab3", "name" => GetMessage("BPWC_WNCT_TL_HISTORY"), "title" => GetMessage("BPWC_WNCT_TL_HISTORY"), "icon" => "", "fields" => array(array("id" => "GRID", "name" => GetMessage("BPWC_WNCT_TL_HISTORY"), "type" => "custom", "value" => $gridTmp, "colspan" => true)));
    $APPLICATION->IncludeComponent("bitrix:main.interface.form", "", array("FORM_ID" => $arResult["FORM_ID"], "TABS" => $arTabs, "BUTTONS" => array("custom_html" => "", "standard_buttons" => false), "DATA" => $arResult["BP"], "THEME_GRID_ID" => "user_grid", "SHOW_SETTINGS" => "Y", "AJAX_MODE" => "N", "AJAX_OPTION_JUMP" => "N", "AJAX_OPTION_STYLE" => "Y"), $component);
}