CBPRestActivity::GetPropertiesDialog: Bitrix method

      
<?php 
//  CBPRestActivity :: GetPropertiesDialog()
//  /dist/bitrix/modules/bizproc/classes/general/restactivity.php:337

    
public static function GetPropertiesDialog($documentType$activityName$workflowTemplate$workflowParameters$workflowVariables$currentValues null$formName "")
    {
        if (!
Loader::includeModule('rest'))
        {
            return 
false;
        }

        
$activityData self::getRestActivityData();

        
$dbRes = \Bitrix\Rest\AppTable::getList([
            
'select' => ['ID'],
            
'filter' => [
                
'=CLIENT_ID' => $activityData['APP_ID'],
            ]
        ]);
        
$application $dbRes->fetch();

        if (
$application)
        {
            
$activityData['APP_ID_INT'] = $application['ID'];
        }

        
$dialog = new \Bitrix\Bizproc\Activity\PropertiesDialog(__FILE__, array(
            
'documentType' => $documentType,
            
'activityName' => $activityName,
            
'workflowTemplate' => $workflowTemplate,
            
'workflowParameters' => $workflowParameters,
            
'workflowVariables' => $workflowVariables,
            
'currentValues' => $currentValues
        
));

        
$map = array(
            
'AuthUserId' => array(
                
'Name' => 'AuthUserId',
                
'FieldName' => 'authuserid',
                
'Type' => 'user',
                
'Default' => 'user_'.$activityData['AUTH_USER_ID']
            ),
            
'SetStatusMessage' => array(
                
'Name' => 'SetStatusMessage',
                
'FieldName' => 'setstatusmessage',
                
'Type' => 'bool',
            ),
            
'StatusMessage' => array(
                
'Name' => 'StatusMessage',
                
'FieldName' => 'statusmessage',
                
'Type' => 'text',
                
'Default' => Loc::getMessage('BPRA_DEFAULT_STATUS_MESSAGE'),
            ),
            
'UseSubscription' => array(
                
'Name' => 'StatusMessage',
                
'FieldName' => 'usesubscription',
                
'Type' => 'bool',
                
'Default' => $activityData['USE_SUBSCRIPTION']
            ),
            
'TimeoutDuration' => array(
                
'Name' => 'StatusMessage',
                
'FieldName' => 'timeoutduration',
                
'Type' => 'int',
            ),
            
'TimeoutDurationType' => array(
                
'Name' => 'StatusMessage',
                
'FieldName' => 'timeoutdurationtype',
                
'Type' => 'string',
                
'Default' => 's'
            
),
        );

        
$properties = isset($activityData['PROPERTIES']) && is_array($activityData['PROPERTIES']) ? $activityData['PROPERTIES'] : array();
        foreach (
$properties as $name => $property)
        {
            if (!
array_key_exists($name$map))
                
$map[$name] = array(
                    
'Name' => RestActivityTable::getLocalization($property['NAME'], LANGUAGE_ID),
                    
'Description' => RestActivityTable::getLocalization($property['DESCRIPTION'], LANGUAGE_ID),
                    
'FieldName' => static::PROPERTY_NAME_PREFIX.strtolower($name),
                    
'Type' => $property['TYPE'],
                    
'Required' => $property['REQUIRED'],
                    
'Multiple' => $property['MULTIPLE'],
                    
'Default' => $property['DEFAULT'],
                    
'Options' => isset($property['OPTIONS']) ? $property['OPTIONS'] : null
                
);
        }

        
$dialog    ->setMap($map)
                ->
setRuntimeData(array('ACTIVITY_DATA' => $activityData))
                ->
setRenderer(array(__CLASS__'renderPropertiesDialog'));

        return 
$dialog;
    }