本文整理汇总了PHP中CBPDocument::GetDocumentAdminPage方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::GetDocumentAdminPage方法的具体用法?PHP CBPDocument::GetDocumentAdminPage怎么用?PHP CBPDocument::GetDocumentAdminPage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPDocument
的用法示例。
在下文中一共展示了CBPDocument::GetDocumentAdminPage方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$dbTask = CBPTaskService::GetList(array(), array("WORKFLOW_ID" => $workflowId, "USER_ID" => $userId), false, false, array("ID", "WORKFLOW_ID", "ACTIVITY", "ACTIVITY_NAME", "MODIFIED", "OVERDUE_DATE", "NAME", "DESCRIPTION", "PARAMETERS", "USER_ID", 'STATUS', 'USER_STATUS'));
$arTask = $dbTask->GetNext();
}
}
if (!$arTask) {
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
$APPLICATION->SetTitle(GetMessage("BPAT_NO_TASK"));
CAdminMessage::ShowMessage(GetMessage("BPAT_NO_TASK") . ". ");
} else {
$arTask["PARAMETERS"]["DOCUMENT_ID"] = CBPStateService::GetStateDocumentId($arTask['WORKFLOW_ID']);
$backUrl = "/" . ltrim(trim($_REQUEST["back_url"]), "\\/");
if (strlen($backUrl) <= 0) {
$backUrl = "/bitrix/admin/bizproc_task_list.php?lang=" . LANGUAGE_ID;
}
if (strlen($backUrl) <= 0 && !empty($arTask["PARAMETERS"]["DOCUMENT_ID"])) {
$backUrl = CBPDocument::GetDocumentAdminPage($arTask["PARAMETERS"]["DOCUMENT_ID"]);
}
$backUrl = CHTTP::urlDeleteParams($backUrl, array('mode'));
$showType = "Form";
if ($arTask['STATUS'] > CBPTaskStatus::Running || $arTask['USER_STATUS'] > CBPTaskUserStatus::Waiting) {
$showType = "Success";
}
if ($_SERVER["REQUEST_METHOD"] == "POST" && check_bitrix_sessid()) {
if ($_POST["action"] == "doTask") {
$arErrorsTmp = array();
if (CBPDocument::PostTaskForm($arTask, $userId, $_REQUEST + $_FILES, $arErrorsTmp, $USER->GetFormattedName(false))) {
$showType = "Success";
if (strlen($backUrl) > 0) {
LocalRedirect($backUrl);
die;
}
示例2: trim
$arParams["PATH_TO_BIZPROC_EDIT"] = trim($arParams["PATH_TO_BIZPROC_EDIT"]);
if (strlen($arParams["PATH_TO_BIZPROC_EDIT"]) <= 0) {
$arParams["PATH_TO_BIZPROC_EDIT"] = htmlspecialcharsbx($APPLICATION->GetCurPage() . "?" . $arParams["PAGE_VAR"] . "=bizproc_edit&" . $arParams["TASK_VAR"] . "=#task_id#");
}
if (!$GLOBALS["USER"]->IsAuthorized()) {
$arResult["NEED_AUTH"] = "Y";
} else {
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle(GetMessage("SONET_BIZPROC_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] != "N") {
$APPLICATION->AddChainItem(GetMessage("SONET_BIZPROC_TITLE"));
}
$dbResultList = CBPTaskService::GetList(array("MODIFIED" => "DESC"), array("USER_ID" => $USER->GetID()), false, false, array("ID", "WORKFLOW_ID", "ACTIVITY", "ACTIVITY_NAME", "MODIFIED", "OVERDUE_DATE", "NAME", "DESCRIPTION", "PARAMETERS"));
while ($arResultItem = $dbResultList->GetNext()) {
if (strlen($arResultItem["DESCRIPTION"]) > 100) {
$arResultItem["DESCRIPTION"] = substr($arResultItem["DESCRIPTION"], 0, 97) . "...";
}
$arResultItem["EditUrl"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BIZPROC_EDIT"], array("task_id" => $arResultItem["ID"]));
$arResult["TASKS"][] = $arResultItem;
}
$dbTracking = CBPTrackingService::GetList(array("MODIFIED" => "DESC"), array("MODIFIED_BY" => $USER->GetID()));
while ($arTracking = $dbTracking->GetNext()) {
if (strlen($arTracking["WORKFLOW_ID"]) > 0) {
$arTracking["STATE"] = CBPStateService::GetWorkflowState($arTracking["WORKFLOW_ID"]);
$arTracking["STATE"]["Url"] = CBPDocument::GetDocumentAdminPage($arTracking["STATE"]["DOCUMENT_ID"]);
}
$arResult["TRACKING"][] = $arTracking;
}
}
$this->IncludeComponentTemplate();
示例3: ShowError
$arResult['TASK']['DESCRIPTION'] = '';
}
$arState = CBPStateService::GetWorkflowState($arResult['TASK']['WORKFLOW_ID']);
if (!$arState) {
ShowError(GetMessage("BPAT_NO_STATE"));
// Let`s clean up!
CBPTaskService::DeleteByWorkflow($arResult['TASK']['WORKFLOW_ID']);
return false;
}
$arResult['TASK']['PARAMETERS']['DOCUMENT_ID'] = $arState['DOCUMENT_ID'];
$arResult["TASK"]["MODULE_ID"] = $arResult["TASK"]["PARAMETERS"]["DOCUMENT_ID"][0];
$arResult["TASK"]["ENTITY"] = $arResult["TASK"]["PARAMETERS"]["DOCUMENT_ID"][1];
$arResult["TASK"]["DOCUMENT_ID"] = $arResult["TASK"]["PARAMETERS"]["DOCUMENT_ID"][2];
$arParams["DOCUMENT_URL"] = trim($arParams["DOCUMENT_URL"]);
if (empty($arParams["DOCUMENT_URL"])) {
$arParams["DOCUMENT_URL"] = CBPDocument::GetDocumentAdminPage($arResult["TASK"]["PARAMETERS"]["DOCUMENT_ID"]);
} else {
$arParams["DOCUMENT_URL"] = CComponentEngine::MakePathFromTemplate($arParams["DOCUMENT_URL"], $arResult["TASK"]);
}
$arResult["TASK"]["URL"] = array("VIEW" => htmlspecialcharsbx($arParams["DOCUMENT_URL"]), "~VIEW" => $arParams["DOCUMENT_URL"]);
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["action"] == "doTask" && check_bitrix_sessid()) {
$arErrorsTmp = array();
if (CBPDocument::PostTaskForm($arResult["TASK"], $arParams['USER_ID'], $_REQUEST + $_FILES, $arErrorsTmp, $USER->GetFormattedName(false))) {
$arResult["ShowMode"] = "Success";
$d = CBPTaskService::GetList(array(), array('WORKFLOW_ID' => $arResult['TASK']['WORKFLOW_ID'], 'USER_ID' => $arParams['USER_ID'], 'USER_STATUS' => CBPTaskUserStatus::Waiting), false, false, array("ID"));
if ($r = $d->Fetch()) {
$backUrl = CComponentEngine::MakePathFromTemplate($arParams["TASK_EDIT_URL"], array("ID" => $r["ID"], "task_id" => $r["ID"]));
} else {
$backUrl = $arResult["backUrl"];
}
if (strlen($backUrl) > 0) {
示例4: array
$hgridSort = $hgridOptions->GetSorting(array("sort" => array("ID" => "desc")));
$arResult["H_HEADERS"] = array(array("id" => "MODIFIED", "name" => GetMessage("BPATL_MODIFIED"), "default" => true, "sort" => ""), array("id" => "ACTION_NOTE", "name" => GetMessage("BPATL_DESCRIPTION"), "default" => true, "sort" => ""));
$arResult["H_SORT"] = $hgridSort["sort"];
$arResult["H_RECORDS"] = array();
$arFilter = array("MODIFIED_BY" => $arParams["USER_ID"]);
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"] = preg_replace_callback("/\\{=([A-Za-z0-9_]+)\\:([A-Za-z0-9_]+)\\}/i", create_function('$matches', 'return __bwl_ParseStringParameterTmp1($matches, array("' . $dt[0] . '", "' . $dt[1] . '", "' . $dt[2] . '"));'), $arRecord["ACTION_NOTE"]);
}
$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();
示例5: executeComponent
public function executeComponent()
{
if ($this->arParams['SET_TITLE']) {
$this->setPageTitle(Loc::getMessage('BPWI_PAGE_TITLE'));
}
if (!empty($_POST['ID']) && check_bitrix_sessid() && $this->isAdmin()) {
foreach ((array) $_POST['ID'] as $id) {
CBPDocument::killWorkflow($id);
}
}
$selectFields = array('ID', 'MODIFIED', 'OWNER_ID', 'OWNED_UNTIL', 'WS_MODULE_ID' => $this->getFieldName('WS_MODULE_ID'), 'WS_ENTITY' => $this->getFieldName('WS_ENTITY'), 'WS_DOCUMENT_ID' => $this->getFieldName('WS_DOCUMENT_ID'));
$gridColumns = $this->getGridOptions()->getVisibleColumns();
$this->arResult['HEADERS'] = $this->getGridHeaders();
$showDocumentName = false;
foreach ($this->arResult['HEADERS'] as $h) {
if ((count($gridColumns) <= 0 || in_array($h['id'], $gridColumns)) && !in_array($h['id'], $selectFields)) {
if ($this->getFieldName($h['id'])) {
$selectFields[$h['id']] = $this->getFieldName($h['id']);
} elseif ($h['id'] == 'IS_LOCKED' && !in_array('OWNED_UNTIL', $selectFields)) {
$selectFields['OWNED_UNTIL'] = $this->getFieldName('OWNED_UNTIL');
} elseif ($h['id'] == 'WS_DOCUMENT_NAME') {
$showDocumentName = true;
}
}
}
if (isset($selectFields['WS_STARTED_BY'])) {
$selectFields['WS_STARTED_USER_NAME'] = $this->getFieldName('WS_STARTED_USER_NAME');
$selectFields['WS_STARTED_USER_LAST_NAME'] = $this->getFieldName('WS_STARTED_USER_LAST_NAME');
$selectFields['WS_STARTED_USER_LOGIN'] = $this->getFieldName('WS_STARTED_USER_LOGIN');
}
$filter = array();
$templatesFilter = array();
$this->arResult['DOCUMENT_TYPES'] = $this->getDocumentTypes();
if (!empty($_REQUEST['type']) && isset($this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']])) {
$this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']]['ACTIVE'] = true;
if (!empty($this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']]['MODULE_ID'])) {
$filter = array('=' . $this->getFieldName('WS_MODULE_ID') => $this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']]['MODULE_ID']);
$templatesFilter = array('MODULE_ID' => $filter[$this->getFieldName('WS_MODULE_ID')]);
if (!empty($this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']]['ENTITY'])) {
$filter['=' . $this->getFieldName('WS_ENTITY')] = $this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']]['ENTITY'];
$templatesFilter['ENTITY'] = $this->arResult['DOCUMENT_TYPES'][$_REQUEST['type']]['ENTITY'];
}
} elseif ($_REQUEST['type'] == 'is_locked') {
global $DB;
$filter['<OWNED_UNTIL'] = date($DB->DateFormatToPHP(FORMAT_DATETIME), $this->getLockedTime());
}
} else {
$this->arResult['DOCUMENT_TYPES']['*']['ACTIVE'] = true;
}
$templatesList = array('' => Loc::getMessage('BPWI_WORKFLOW_ID_ANY'));
$dbResTmp = \CBPWorkflowTemplateLoader::GetList(array('NAME' => 'ASC'), $templatesFilter, false, false, array('ID', 'NAME'));
while ($arResTmp = $dbResTmp->GetNext()) {
$templatesList[$arResTmp['ID']] = $arResTmp['NAME'];
}
$this->arResult['FILTER'] = $this->getFilter();
$this->arResult['FILTER'][] = array('id' => 'WS_WORKFLOW_TEMPLATE_ID', 'name' => Loc::getMessage('BPWI_WS_WORKFLOW_TEMPLATE_ID'), 'type' => 'list', 'items' => $templatesList);
$gridFilter = $this->getGridOptions()->getFilter($this->arResult['FILTER']);
$filter = $this->mergeFilters($filter, $gridFilter);
if (!$this->isAdmin()) {
global $USER;
$filter['=' . $this->getFieldName('WS_STARTED_BY')] = $USER->getId();
}
list($currentPage, $pageSize, $offset) = $this->getPaginationInfo();
$this->arResult['SORT'] = $this->getSorting();
$this->arResult['CURRENT_PAGE'] = $currentPage;
$this->arResult['SHOW_NEXT_PAGE'] = false;
$this->arResult['RECORDS'] = array();
$iterator = WorkflowInstanceTable::getList(array('order' => $this->arResult['SORT'], 'select' => $selectFields, 'filter' => $filter, 'limit' => $pageSize + 1, 'offset' => $offset));
$rowsCount = 0;
while ($row = $iterator->fetch()) {
$rowsCount++;
if ($rowsCount > $pageSize) {
$this->arResult['SHOW_NEXT_PAGE'] = true;
break;
}
$row['WS_WORKFLOW_TEMPLATE_ID'] = $row['WS_WORKFLOW_TEMPLATE_ID'] ? $templatesList[$row['WS_WORKFLOW_TEMPLATE_ID']] : null;
$row['IS_LOCKED'] = $row['OWNED_UNTIL'] && $row['OWNED_UNTIL']->getTimestamp() < $this->getLockedTime();
if (!empty($row['WS_STARTED_BY'])) {
$row['WS_STARTED_BY'] = CUser::FormatName($this->arParams["NAME_TEMPLATE"], array('LOGIN' => $row['WS_STARTED_USER_LOGIN'], 'NAME' => $row['WS_STARTED_USER_NAME'], 'LAST_NAME' => $row['WS_STARTED_USER_LAST_NAME']), true) . " [" . $row['WS_STARTED_BY'] . "]";
}
$row['DOCUMENT_URL'] = $row['WS_DOCUMENT_NAME'] = '';
if (!empty($row['WS_MODULE_ID'])) {
$row['DOCUMENT_URL'] = CBPDocument::GetDocumentAdminPage(array($row['WS_MODULE_ID'], $row['WS_ENTITY'], $row['WS_DOCUMENT_ID']));
if ($showDocumentName) {
$row['WS_DOCUMENT_NAME'] = CBPDocument::getDocumentName(array($row['WS_MODULE_ID'], $row['WS_ENTITY'], $row['WS_DOCUMENT_ID']));
}
}
$rowActions = array(array("ICONCLASS" => "edit", "DEFAULT" => true, "TEXT" => Loc::getMessage("BPWI_OPEN_DOCUMENT"), "ONCLICK" => $row['DOCUMENT_URL'] ? "window.open('" . $row["DOCUMENT_URL"] . "');" : 'alert(\'' . Loc::getMessage('BPWI_NO_DOCUMENT') . '\')'));
if ($this->isAdmin()) {
$rowActions[] = array("ICONCLASS" => "delete", "TEXT" => Loc::getMessage("BPWI_DELETE_LABEL"), "ONCLICK" => "bxGrid_" . static::GRID_ID . ".DeleteItem('" . $row['ID'] . "', '" . Loc::getMessage("BPWI_DELETE_CONFIRM") . "')");
}
$this->arResult['RECORDS'][] = array('data' => $row, 'editable' => $this->isAdmin(), 'actions' => $rowActions);
}
$this->arResult['ROWS_COUNT'] = sizeof($this->arResult['RECORDS']);
$this->arResult['GRID_ID'] = static::GRID_ID;
$this->arResult['FILTER_PRESETS'] = $this->getFilterPresets();
$this->arResult['EDITABLE'] = $this->isAdmin();
$this->includeComponentTemplate();
}
示例6: array
}
}
$showMode = "WorkflowParameters";
}
} else {
$showMode = "SelectWorkflow";
}
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
CBPDocument::AddShowParameterInit(MODULE_ID, "only_users", $documentType[2], $documentType[1]);
if (strlen($fatalErrorMessage) > 0) {
$APPLICATION->SetTitle(GetMessage("BPABS_ERROR"));
CAdminMessage::ShowMessage($fatalErrorMessage);
} else {
if (strlen($backUrl) <= 0) {
$backUrl = CBPDocument::GetDocumentAdminPage($documentId);
}
$aMenu = array(array("TEXT" => GetMessage("BPABS_BACK"), "LINK" => $backUrl, "ICON" => "btn_list"));
$context = new CAdminContextMenu($aMenu);
$context->Show();
$APPLICATION->SetTitle(GetMessage("BPABS_TITLE"));
CAdminMessage::ShowMessage($errorMessage);
if ($showMode == "StartWorkflowSuccess") {
?>
<?php
echo str_replace("#TEMPLATE#", $arWorkflowTemplates[$workflowTemplateId]["NAME"], GetMessage("BPABS_MESSAGE_SUCCESS"));
?>
<?php
} elseif ($showMode == "StartWorkflowError") {
?>
<?php
示例7: array
$arWorkflowState = CBPStateService::GetWorkflowState($ID);
if (!is_array($arWorkflowState) || count($arWorkflowState) <= 0) {
$APPLICATION->SetTitle(GetMessage("BPABL_INVALID_WF"));
CAdminMessage::ShowMessage(GetMessage("BPABL_INVALID_WF") . ". ");
} else {
$bCanView = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $arWorkflowState["DOCUMENT_ID"], array("WorkflowId" => $ID, "DocumentStates" => array($ID => $arWorkflowState), "UserGroups" => $GLOBALS["USER"]->GetUserGroupArray()));
if (!$bCanView) {
$APPLICATION->SetTitle(GetMessage("BPABL_ERROR"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
echo ShowError(GetMessage("BPABL_NO_PERMS"));
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
die;
}
$backUrl = "/" . ltrim(trim($_REQUEST["back_url"]), "\\/");
if (strlen($backUrl) <= 0) {
$backUrl = CBPDocument::GetDocumentAdminPage($arWorkflowState["DOCUMENT_ID"]);
}
$aMenu = array(array("TEXT" => GetMessage("BPABL_BACK"), "LINK" => $backUrl, "ICON" => "btn_list"));
$context = new CAdminContextMenu($aMenu);
$context->Show();
$APPLICATION->SetTitle(str_replace("#ID#", $ID, GetMessage("BPABL_TITLE")));
$aTabs = array(array("DIV" => "edit1", "TAB" => GetMessage("BPABL_WF_TAB"), "ICON" => "bizproc", "TITLE" => GetMessage("BPABL_TAB_TITLE")));
$tabControl = new CAdminTabControl("tabControl", $aTabs);
$tabControl->Begin();
$tabControl->BeginNextTab();
?>
<tr>
<td align="right" valign="top" width="50%"><?php
echo GetMessage("BPABL_NAME");
?>
:</td>