RestService::getTaskList: Bitrix method

      
<?php 
//  Bitrix\Bizproc\RestService :: getTaskList()
//  /dist/bitrix/modules/bizproc/lib/restservice.php:924

    
public static function getTaskList($params$n$server)
    {
        
$params array_change_key_case($paramsCASE_UPPER);

        
$fields = array(
            
'ID' => 'ID',
            
'ACTIVITY' => 'ACTIVITY',
            
'ACTIVITY_NAME' => 'ACTIVITY_NAME',
            
'WORKFLOW_ID' => 'WORKFLOW_ID',
            
'DOCUMENT_NAME' => 'DOCUMENT_NAME',
            
'DESCRIPTION' => 'DESCRIPTION',
            
'NAME' => 'NAME',
            
'MODIFIED' => 'MODIFIED',
            
'WORKFLOW_STARTED' => 'WORKFLOW_STARTED',
            
'WORKFLOW_STARTED_BY' => 'WORKFLOW_STARTED_BY',
            
'OVERDUE_DATE' => 'OVERDUE_DATE',
            
'WORKFLOW_TEMPLATE_ID' => 'WORKFLOW_TEMPLATE_ID',
            
'WORKFLOW_TEMPLATE_NAME' => 'WORKFLOW_TEMPLATE_NAME',
            
'WORKFLOW_STATE' => 'WORKFLOW_STATE',
            
'STATUS' => 'STATUS',
            
'USER_ID' => 'USER_ID',
            
'USER_STATUS' => 'USER_STATUS',
            
'MODULE_ID' => 'MODULE_ID',
            
'ENTITY' => 'ENTITY',
            
'DOCUMENT_ID' => 'DOCUMENT_ID',
            
'PARAMETERS' => 'PARAMETERS',
        );

        
$select = static::getSelect($params['SELECT'], $fields, array('ID''WORKFLOW_ID''DOCUMENT_NAME''NAME'));
        
$select array_merge(array('MODULE''ENTITY''DOCUMENT_ID'), $select);
        
$filter = static::getFilter($params['FILTER'], $fields, array('MODIFIED''WORKFLOW_STARTED''OVERDUE_DATE'));
        
$order = static::getOrder($params['ORDER'], $fields, array('ID' => 'DESC'));

        
$currentUserId self::getCurrentUserId();
        
$isAdmin = static::isAdmin();

        if (!
$isAdmin && !isset($filter['USER_ID']))
        {
            
$filter['USER_ID'] = $currentUserId;
        }

        
$targetUserId = isset($filter['USER_ID'])? (int)$filter['USER_ID'] : 0;
        if (
$targetUserId !== $currentUserId && !\CBPHelper::checkUserSubordination($currentUserId$targetUserId))
        {
            
self::checkAdminPermissions();
        }

        
$iterator = \CBPTaskService::getList(
            
$order,
            
$filter,
            
false,
            static::
getNavData($n),
            
$select
        
);

        
$result = array();
        while (
$row $iterator->fetch())
        {
            if (isset(
$row['MODIFIED']))
                
$row['MODIFIED'] = \CRestUtil::convertDateTime($row['MODIFIED']);
            if (isset(
$row['WORKFLOW_STARTED']))
                
$row['WORKFLOW_STARTED'] = \CRestUtil::convertDateTime($row['WORKFLOW_STARTED']);
            if (isset(
$row['OVERDUE_DATE']))
                
$row['OVERDUE_DATE'] = \CRestUtil::convertDateTime($row['OVERDUE_DATE']);
            
$row['DOCUMENT_URL'] = \CBPDocument::getDocumentAdminPage(array(
                
$row['MODULE_ID'], $row['ENTITY'], $row['DOCUMENT_ID']
            ));

            if (isset(
$row['PARAMETERS']))
            {
                
$row['PARAMETERS'] = static::filterTaskParameters($row['PARAMETERS']);
            }

            
$result[] = $row;
        }

        return static::
setNavData($result$iterator);
    }