CBPHelper::ConvertUserToPrintableForm: Bitrix method

      
<?php 
//  CBPHelper :: ConvertUserToPrintableForm()
//  /dist/bitrix/modules/bizproc/classes/general/helper.php:981

    
public static function ConvertUserToPrintableForm($userId$nameTemplate "")
    {
        if (
substr($userId0strlen("user_")) == "user_")
        {
            
$userId substr($userIdstrlen("user_"));
        }

        if (empty(
$nameTemplate))
        {
            
$nameTemplate COption::GetOptionString("bizproc""name_template"CSite::GetNameFormat(false), SITE_ID);
        }

        
$userId intval($userId);

        
$db CUser::GetList(
            (
$by "LAST_NAME"),
            (
$order "asc"),
            array(
"ID_EQUAL_EXACT" => $userId),
            array(
                
"NAV_PARAMS" => false,
            )
        );

        
$str "";
        if (
$ar $db->Fetch())
        {
            
$str CUser::FormatName($nameTemplate$artrue);
            
$str $str." [".$ar["ID"]."]";
            
$str str_replace(","" "$str);
        }

        return 
$str;
    }