CBPVirtualDocument::GetFieldInputValuePrintable: Bitrix method

      
<?php 
//  CBPVirtualDocument :: GetFieldInputValuePrintable()
//  /dist/bitrix/modules/bizproc/classes/general/virtualdocument.php:752

    
function GetFieldInputValuePrintable($documentType$arFieldType$fieldValue)
    {
        
$result $fieldValue;

        switch (
$arFieldType['Type'])
        {
            case 
"S:UserID":
                if (!
is_array($fieldValue))
                    
$fieldValue = array($fieldValue);

                
$result CBPHelper::UsersArrayToString($fieldValuenull, array("bizproc""CBPVirtualDocument"$documentType));
                break;

            case 
"B":
                if (
is_array($fieldValue))
                {
                    
$result = array();
                    foreach (
$fieldValue as $r)
                        
$result[] = ((strtoupper($r) != "N" && !empty($r)) ? GetMessage("BPVDX_YES") : GetMessage("BPVDX_NO"));
                }
                else
                {
                    
$result = ((strtoupper($fieldValue) != "N" && !empty($fieldValue)) ? GetMessage("BPVDX_YES") : GetMessage("BPVDX_NO"));
                }
                break;

            case 
"F":
                if (
is_array($fieldValue))
                {
                    
$result = array();
                    foreach (
$fieldValue as $r)
                    {
                        
$r intval($r);
                        
$dbImg CFile::GetByID($r);
                        if (
$arImg $dbImg->Fetch())
                            
$result[] = "[url=/bitrix/tools/bizproc_show_file.php?f=".urlencode($arImg["FILE_NAME"])."&i=".$r."]".htmlspecialcharsbx($arImg["ORIGINAL_NAME"])."[/url]";
                    }
                }
                else
                {
                    
$fieldValue intval($fieldValue);
                    
$dbImg CFile::GetByID($fieldValue);
                    if (
$arImg $dbImg->Fetch())
                        
$result "[url=/bitrix/tools/bizproc_show_file.php?f=".urlencode($arImg["FILE_NAME"])."&i=".$fieldValue."]".htmlspecialcharsbx($arImg["ORIGINAL_NAME"])."[/url]";
                }
                break;
            case 
"L":
                if (
is_array($arFieldType["Options"]))
                {
                    if (
is_array($fieldValue))
                    {
                        
$result = array();
                        foreach (
$fieldValue as $r)
                        {
                            if (
array_key_exists($r$arFieldType["Options"]))
                                
$result[] = $arFieldType["Options"][$r];
                        }
                    }
                    else
                    {
                        if (
array_key_exists($fieldValue$arFieldType["Options"]))
                            
$result $arFieldType["Options"][$fieldValue];
                    }
                }
                break;
        }

        if (
strpos($arFieldType['Type'], ":") !== false)
        {
            if (
$arFieldType["Type"] == "S:employee")
                
$fieldValue CBPHelper::StripUserPrefix($fieldValue);

            
$arCustomType CIBlockProperty::GetUserType(substr($arFieldType['Type'], 2));
            if (
array_key_exists("GetPublicViewHTML"$arCustomType))
            {
                if (
is_array($fieldValue) && !CBPHelper::IsAssociativeArray($fieldValue))
                {
                    
$checkValue $arCustomType["GetPublicViewHTML"][0] == "CIBlockPropertyElementList";
                    
$result = array();
                    foreach (
$fieldValue as $value)
                    {
                        
$v $checkValue && isset($value['VALUE']) ? $value : array('VALUE' => $value);
                        
$r call_user_func_array(
                            
$arCustomType["GetPublicViewHTML"],
                            array(
                                array(
"LINK_IBLOCK_ID" => $arFieldType["Options"]),
                                
$v,
                                
""
                            
)
                        );

                        
$result[] = HTMLToTxt($r);
                    }
                }
                else
                {
                    
$result call_user_func_array(
                        
$arCustomType["GetPublicViewHTML"],
                        array(
                            array(
"LINK_IBLOCK_ID" => $arFieldType["Options"]),
                            array(
"VALUE" => $fieldValue),
                            
""
                        
)
                    );

                    
$result HTMLToTxt($result);
                }
            }
        }

        return 
$result;
    }