Пример #1
0
    }
}
$arWorkflowTemplate = isset($_POST['arWorkflowTemplate']) && is_array($_POST['arWorkflowTemplate']) ? $_POST['arWorkflowTemplate'] : array();
$arWorkflowParameters = isset($_POST['arWorkflowParameters']) && is_array($_POST['arWorkflowParameters']) ? $_POST['arWorkflowParameters'] : array();
$arWorkflowVariables = isset($_POST['arWorkflowVariables']) && is_array($_POST['arWorkflowVariables']) ? $_POST['arWorkflowVariables'] : array();
$arWorkflowConstants = isset($_POST['arWorkflowConstants']) && is_array($_POST['arWorkflowConstants']) ? $_POST['arWorkflowConstants'] : array();
$selectorMode = isset($_POST['selectorMode']) ? $_POST['selectorMode'] : null;
$runtime = CBPRuntime::GetRuntime();
$runtime->StartRuntime();
$documentService = $runtime->GetService("DocumentService");
$documentFields = $documentService->GetDocumentFields($documentType);
$documentFieldTypes = $documentService->GetDocumentFieldTypes($documentType);
$arUsers = array();
$arAllowableUserGroups = $documentService->GetAllowableUserGroups($documentType, true);
foreach ($arAllowableUserGroups as $gId => $gName) {
    $a = CBPHelper::extractUsersFromExtendedGroup($gId);
    if ($a === false) {
        $a = $documentService->GetUsersFromUserGroup($gId, $documentType);
    }
    foreach ($a as $v) {
        if (!in_array($v, $arUsers)) {
            $arUsers[] = $v;
        }
    }
}
switch ($_POST['fieldType']) {
    case "int":
    case "double":
        $arFilter = array("int", "double");
        break;
    case "date":