本文整理汇总了PHP中CBPDocument::GetAllowableUserGroups方法的典型用法代码示例。如果您正苦于以下问题:PHP CBPDocument::GetAllowableUserGroups方法的具体用法?PHP CBPDocument::GetAllowableUserGroups怎么用?PHP CBPDocument::GetAllowableUserGroups使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBPDocument
的用法示例。
在下文中一共展示了CBPDocument::GetAllowableUserGroups方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MakeTimeStamp
return 1;
}
$res1 = MakeTimeStamp($arr1["STATE_MODIFIED"]);
$res2 = MakeTimeStamp($arr2["STATE_MODIFIED"]);
return $res1 < $res2 ? 1 : -1;
}
}
if (!empty($arResult["ERROR_MESSAGE"])) {
ShowError($arResult["ERROR_MESSAGE"]);
}
CBPDocument::AddShowParameterInit($arParams["MODULE_ID"], "only_users", $arParams["DOCUMENT_TYPE"]);
$bizProcIndex = 0;
$bEmpty = true;
$bShowButtons = false;
$arDocumentStates = CBPDocument::GetDocumentStates($arParams["DOCUMENT_TYPE"], $arParams["DOCUMENT_ID"]);
$arGroups = CBPDocument::GetAllowableUserGroups($arParams["DOCUMENT_TYPE"]);
$arUsers = array();
uasort($arDocumentStates, "__bp_sort_in_template_by_modified");
?>
<div class="bizproc-page-document">
<form action="<?php
echo POST_FORM_ACTION_URI;
?>
" method="POST" class="bizproc-form" name="start_workflow_form1" id="start_workflow_form1">
<?php
echo bitrix_sessid_post();
?>
<input type="hidden" name="back_url" value="<?php
echo htmlspecialcharsbx($arParams["back_url"]);
?>
示例2: GetMessage
$arResult["FatalErrorMessage"] .= GetMessage("BPABL_INVALID_WF") . ". ";
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$documentId = $arWorkflowState["DOCUMENT_ID"];
$bCanView = CBPDocument::CanUserOperateDocument(CBPCanUserOperateOperation::ViewWorkflow, $GLOBALS["USER"]->GetID(), $documentId, array("WorkflowId" => $arParams["ID"]));
if (!$bCanView) {
$arResult["FatalErrorMessage"] .= GetMessage("BPABL_NO_PERMS") . ". ";
}
}
if (strlen($arResult["FatalErrorMessage"]) <= 0) {
$runtime = CBPRuntime::GetRuntime();
$runtime->StartRuntime();
$documentService = $runtime->GetService("DocumentService");
$documentType = $documentService->GetDocumentType($documentId);
$GLOBALS["__bwl1_ParseStringParameterTmp_arAllowableUserGroups"] = CBPDocument::GetAllowableUserGroups($documentType);
function __bwl1_ParseStringParameterTmp($matches)
{
$result = "";
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = htmlspecialcharsbx(CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l))));
} else {
$result = $GLOBALS["__bwl1_ParseStringParameterTmp_arAllowableUserGroups"][$user];
}
} elseif ($matches[1] == "group") {
$result = $GLOBALS["__bwl1_ParseStringParameterTmp_arAllowableUserGroups"][$matches[2]];
} else {
$result = $matches[0];
示例3: UsersStringToArray
public static function UsersStringToArray($strUsers, $documentType, &$arErrors, $callbackFunction = null)
{
$arErrors = array();
$strUsers = trim($strUsers);
if (strlen($strUsers) <= 0) {
return $callbackFunction != null ? array(array(), array()) : array();
}
$arUsers = array();
$strUsers = str_replace(";", ",", $strUsers);
$arUsersTmp = explode(",", $strUsers);
foreach ($arUsersTmp as $user) {
$user = trim($user);
if (strlen($user) > 0) {
$arUsers[] = $user;
}
}
$arAllowableUserGroups = null;
$arResult = array();
$arResultAlt = array();
foreach ($arUsers as $user) {
$bCorrectUser = false;
$bNotFoundUser = true;
if (preg_match("/\\{=([a-zA-Z0-9_]+):([a-zA-Z0-9_]+)\\}/i", $user, $arMatches)) {
$bCorrectUser = true;
$arResult[] = "{=" . $arMatches[1] . ":" . $arMatches[2] . "}";
//if (count($arUsers) == 1)
//{
//$arResult = $arResult[0];
//break;
//}
} else {
if ($arAllowableUserGroups == null) {
$arAllowableUserGroups = array();
$arAllowableUserGroupsTmp = CBPDocument::GetAllowableUserGroups($documentType);
foreach ($arAllowableUserGroupsTmp as $k1 => $v1) {
$arAllowableUserGroups[strtolower($k1)] = strtolower($v1);
}
}
if (array_key_exists(strtolower($user), $arAllowableUserGroups)) {
$bCorrectUser = true;
$arResult[] = $user;
} elseif (($k1 = array_search(strtolower($user), $arAllowableUserGroups)) !== false) {
$bCorrectUser = true;
$arResult[] = $k1;
} else {
$ar = self::SearchUserByName($user);
$cnt = count($ar);
if ($cnt == 1) {
$bCorrectUser = true;
$arResult[] = "user_" . $ar[0];
} elseif ($cnt > 1) {
$bNotFoundUser = false;
$arErrors[] = array("code" => "Ambiguous", "message" => str_replace("#USER#", htmlspecialcharsbx($user), GetMessage("BPCGHLP_AMBIGUOUS_USER")));
} elseif ($callbackFunction != null) {
$s = call_user_func_array($callbackFunction, array($user));
if ($s != null) {
$arResultAlt[] = $s;
$bCorrectUser = true;
}
}
}
}
if (!$bCorrectUser) {
if ($bNotFoundUser) {
$arErrors[] = array("code" => "NotFound", "message" => str_replace("#USER#", htmlspecialcharsbx($user), GetMessage("BPCGHLP_INVALID_USER")));
}
}
}
return $callbackFunction != null ? array($arResult, $arResultAlt) : $arResult;
}
示例4: parseStringParameterMatches
public static function parseStringParameterMatches($matches, $documentType = null)
{
$result = "";
$documentType = is_array($documentType) ? array_filter($documentType) : null;
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l)));
} elseif (strpos($user, 'group_') === 0) {
$result = htmlspecialcharsbx(CBPHelper::getExtendedGroupName($user));
} elseif ($documentType) {
$v = implode(",", $documentType);
if (!array_key_exists($v, self::$userGroupsCache)) {
self::$userGroupsCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = self::$userGroupsCache[$v][$user];
} else {
$result = $user;
}
} elseif ($matches[1] == "group") {
if (strpos($matches[2], 'group_') === 0) {
$result = htmlspecialcharsbx(CBPHelper::getExtendedGroupName($matches[2]));
} elseif ($documentType) {
$v = implode(",", $documentType);
if (!array_key_exists($v, self::$userGroupsCache)) {
self::$userGroupsCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = self::$userGroupsCache[$v][$matches[2]];
} else {
$result = $matches[2];
}
} else {
$result = $matches[0];
}
return $result;
}
示例5: __bwl_ParseStringParameterTmp1
function __bwl_ParseStringParameterTmp1($matches, $documentType)
{
static $varCache = array();
$result = "";
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = htmlspecialcharsbx(CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l))));
} else {
$v = implode(",", $documentType);
if (!array_key_exists($v, $varCache)) {
$varCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = $varCache[$v][$user];
}
} elseif ($matches[1] == "group") {
$v = implode(",", $documentType);
if (!array_key_exists($v, $varCache)) {
$varCache[$v] = CBPDocument::GetAllowableUserGroups($documentType);
}
$result = $varCache[$v][$matches[2]];
} else {
$result = $matches[0];
}
return $result;
}
示例6: array
continue;
}
if (in_array($value["BaseType"], array("user"))) {
continue;
}
$arFieldsTmp[] = array("id" => $key, "name" => $value["Name"], "type" => "label");
}
$arTabs[] = array("id" => "tab2", "name" => GetMessage("BPWC_WNCT_TAB2"), "title" => GetMessage("BPWC_WNCT_TAB2"), "icon" => "", "fields" => $arFieldsTmp);
$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"]);
$GLOBALS["__bwl_ParseStringParameterTmp1_arAllowableUserGroups"] = CBPDocument::GetAllowableUserGroups($arResult["DocumentType"]);
function __bwl_ParseStringParameterTmp1($matches)
{
$result = "";
if ($matches[1] == "user") {
$user = $matches[2];
$l = strlen("user_");
if (substr($user, 0, $l) == "user_") {
$result = htmlspecialcharsbx(CBPHelper::ConvertUserToPrintableForm(intval(substr($user, $l))));
} else {
$result = $GLOBALS["__bwl_ParseStringParameterTmp1_arAllowableUserGroups"][$user];
}
} elseif ($matches[1] == "group") {
$result = $GLOBALS["__bwl_ParseStringParameterTmp1_arAllowableUserGroups"][$matches[2]];
} else {
$result = $matches[0];