1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Класс CBPDocument

Открытые статические члены

static migrateDocumentType ($oldType, $newType)
static getDocumentStates ($documentType, $documentId=null)
static getActiveStates (array $documentId, $limit=0)
static getDocumentState ($documentId, $workflowId)
static mergeDocuments ($firstDocumentId, $secondDocumentId)
static getAllowableEvents ($userId, $arGroups, $arState, $appendExtendedGroups=false)
static addDocumentToHistory ($parameterDocumentId, $name, $userId)
static getAllowableOperations ($userId, $arGroups, $arStates, $appendExtendedGroups=false)
static canOperate ($operation, $userId, $arGroups, $arStates)
static startWorkflow ($workflowTemplateId, $documentId, $parameters, &$errors, $parentWorkflow=null)
static startDebugWorkflow ($workflowTemplateId, $documentId, $parameters, &$errors)
static autoStartWorkflows ($documentType, $autoExecute, $documentId, $arParameters, &$arErrors)
static sendExternalEvent ($workflowId, $workflowEvent, $arParameters, &$arErrors)
static terminateWorkflow ($workflowId, $documentId, &$arErrors, $stateTitle='')
static killWorkflow ($workflowId, $terminate=true, $documentId=null)
static onDocumentDelete ($documentId, &$errors)
static postTaskForm ($arTask, $userId, $arRequest, &$arErrors, $userName="")
static showTaskForm ($arTask, $userId, $userName="", $arRequest=null)
static setTasksUserStatus ($userId, $status, $ids=array(), &$errors=array())
static getTaskControls ($arTask, $userId=0)
static startWorkflowParametersValidate ($templateId, $arWorkflowParameters, $documentType, &$arErrors)
static startWorkflowParametersShow ($templateId, $arWorkflowParameters, $formName, $bVarsFromForm, $documentType=null)
static addShowParameterInit ($module, $type, $document_type, $entity="", $document_id='')
static showParameterField ($type, $name, $values, $arParams=Array())
static _ReplaceTaskURL ($str, $documentType)
static addDefaultWorkflowTemplates ($documentType, $additionalModuleId=null)
static getWorkflowTemplatesForDocumentType ($documentType, $showSystemTemplates=true)
static getNumberOfWorkflowTemplatesForDocumentType ($documentType)
static deleteWorkflowTemplate ($id, $documentType, &$arErrors)
static updateWorkflowTemplate ($id, $documentType, $arFields, &$arErrors)
static canUserOperateDocument ($operation, $userId, $parameterDocumentId, $arParameters=array())
static canUserOperateDocumentType ($operation, $userId, $parameterDocumentType, $arParameters=array())
static getDocumentAdminPage ($parameterDocumentId)
static getDocumentName ($parameterDocumentId)
static getUserTasksForWorkflow ($userId, $workflowId)
static prepareFileForHistory ($documentId, $fileId, $historyIndex)
static isAdmin ()
static getDocumentFromHistory ($historyId, &$arErrors)
static getAllowableUserGroups ($parameterDocumentType)
static onAfterTMDayStart ($data)
static sendB24LimitsNotifyToAdmins ()
static getDocumentFieldsAliasesMap ($fields)
static isExpression ($value)
static parseExpression ($expression)
static signParameters (array $parameters)
static unSignParameters ($unsignedData)
static signDocumentType (array $documentType)
static unSignDocumentType ($unsignedData)
static getTemplatesForStart ($userId, $documentType, $documentId=null, array $parameters=array())
static getUserGroups (array $parameterDocumentType, array $parameterDocumentId, int $userId)

Поля данных

const PARAM_TAGRET_USER = 'TargetUser'
const PARAM_MODIFIED_DOCUMENT_FIELDS = 'ModifiedDocumentField'
const PARAM_USE_FORCED_TRACKING = 'UseForcedTracking'
const PARAM_IGNORE_SIMULTANEOUS_PROCESSES_LIMIT = 'IgnoreSimultaneousProcessesLimit'
const PARAM_DOCUMENT_EVENT_TYPE = 'DocumentEventType'
const PARAM_DOCUMENT_TYPE = '__DocumentType'
const PARAM_PRE_GENERATED_WORKFLOW_ID = 'PreGeneratedWorkflowId'
const PARAM_USED_DOCUMENT_FIELDS = 'UsedDocumentField'

Подробное описание

Bizproc API Helper for external usage.

См. определение в файле document.php строка 13

Методы

◆ _ReplaceTaskURL()

_ReplaceTaskURL ( $str,
$documentType )
static

См. определение в файле document.php строка 1166

◆ addDefaultWorkflowTemplates()

addDefaultWorkflowTemplates ( $documentType,
$additionalModuleId = null )
static

См. определение в файле document.php строка 1178

◆ addDocumentToHistory()

addDocumentToHistory ( $parameterDocumentId,
$name,
$userId )
static

См. определение в файле document.php строка 211

◆ addShowParameterInit()

addShowParameterInit ( $module,
$type,
$document_type,
$entity = "",
$document_id = '' )
static

См. определение в файле document.php строка 985

◆ autoStartWorkflows()

autoStartWorkflows ( $documentType,
$autoExecute,
$documentId,
$arParameters,
& $arErrors )
static

Method auto starts workflow.

Аргументы
array$documentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
int$autoExecute- CBPDocumentEventType (1 = CBPDocumentEventType\Create, 2 = CBPDocumentEventType\Edit).
array$documentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
array$arParameters- Workflow parameters.
array$arErrors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).

См. определение в файле document.php строка 452

◆ canOperate()

canOperate ( $operation,
$userId,
$arGroups,
$arStates )
static

Method check can operate user specified operation in specified state. If specified states are not relevant to state machine returns true. If user can`t do operation return false. Else returns true.

Аргументы
string$operation- Operation.
int$userId- User id.
array$arGroups- User groups.
array$arStates- Workflows states.
Возвращает
bool
Исключения
Exception

См. определение в файле document.php строка 316

◆ canUserOperateDocument()

canUserOperateDocument ( $operation,
$userId,
$parameterDocumentId,
$arParameters = array() )
static

Method checks can user operate specified document with specified operation.

Аргументы
int$operation- operation CBPCanUserOperateOperation.
int$userId- User id.
array$parameterDocumentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
array$arParameters- Additional parameters.
Возвращает
bool

См. определение в файле document.php строка 1422

◆ canUserOperateDocumentType()

canUserOperateDocumentType ( $operation,
$userId,
$parameterDocumentType,
$arParameters = array() )
static

Method checks can user operate specified document type with specified operation.

Аргументы
int$operation- operation CBPCanUserOperateOperation.
int$userId- User id.
array$parameterDocumentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
array$arParameters- Additional parameters.
Возвращает
bool

См. определение в файле document.php строка 1444

◆ deleteWorkflowTemplate()

deleteWorkflowTemplate ( $id,
$documentType,
& $arErrors )
static

Method deletes workflow template.

Аргументы
int$id- Template id.
array$documentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
array$arErrors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).

См. определение в файле document.php строка 1333

◆ getActiveStates()

getActiveStates ( array $documentId,
$limit = 0 )
static

См. определение в файле document.php строка 123

◆ getAllowableEvents()

getAllowableEvents ( $userId,
$arGroups,
$arState,
$appendExtendedGroups = false )
static

Method returns array of events available for specified user and specified state

Аргументы
int$userId- User id.
array$arGroups- User groups.
array$arState- Workflow state.
bool$appendExtendedGroups- Append extended groups.
Возвращает
array - Events array array(array("NAME" => event_name, "TITLE" => event_title), ...).
Исключения
Exception

См. определение в файле document.php строка 171

◆ getAllowableOperations()

getAllowableOperations ( $userId,
$arGroups,
$arStates,
$appendExtendedGroups = false )
static

Method returns allowable operations for specified user in specified states. If specified states are not relevant to state machine returns null. If user has no access returns array(). Else returns operations array(operation, ...).

Аргументы
int$userId- User id.
array$arGroups- User groups.
array$arStates- Workflow states.
bool$appendExtendedGroups- Append extended groups.
Возвращает
array|null - Allowable operations.
Исключения
Exception

См. определение в файле document.php строка 266

◆ getAllowableUserGroups()

getAllowableUserGroups ( $parameterDocumentType)
static

См. определение в файле document.php строка 1569

◆ getDocumentAdminPage()

getDocumentAdminPage ( $parameterDocumentId)
static

Get document admin page URL.

Аргументы
array$parameterDocumentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
Возвращает
?string - URL.

См. определение в файле document.php строка 1463

◆ getDocumentFieldsAliasesMap()

getDocumentFieldsAliasesMap ( $fields)
static

Method returns map of document fields aliases.

Аргументы
array$fieldsDocument fields.
Возвращает
array Aliases.

См. определение в файле document.php строка 1643

◆ getDocumentFromHistory()

getDocumentFromHistory ( $historyId,
& $arErrors )
static

См. определение в файле document.php строка 1546

◆ getDocumentName()

getDocumentName ( $parameterDocumentId)
static
Аргументы
array$parameterDocumentIdDocument Id.
Возвращает
mixed|string
Исключения
CBPArgumentNullException

См. определение в файле document.php строка 1481

◆ getDocumentState()

getDocumentState ( $documentId,
$workflowId )
static

Method returns workflow state for specified document.

Аргументы
array$documentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
string$workflowId- Workflow id.
Возвращает
array - Workflow state array.

См. определение в файле document.php строка 148

◆ getDocumentStates()

getDocumentStates ( $documentType,
$documentId = null )
static

Method returns array of workflow templates and states for specified document. If document id is set method returns array of running and terminated workflow states and also templates which started on document edit action. If document id is not set method returns array of templates which started on document add. Return array example: array( workflow_id_or_template_id => array( "ID" => workflow_id, "TEMPLATE_ID" => template_id, "TEMPLATE_NAME" => template_name, "TEMPLATE_DESCRIPTION" => template_description, "TEMPLATE_PARAMETERS" => template_parameters, "STATE_NAME" => current_state_name, "STATE_TITLE" => current_state_title, "STATE_MODIFIED" => state_modified_datetime, "STATE_PARAMETERS" => state_parameters, "STATE_PERMISSIONS" => state_permissions, "WORKFLOW_STATUS" => workflow_status, ), . . . ) TEMPLATE_PARAMETERS example: array( "param1" => array( "Name" => "Parameter 1", "Description" => "", "Type" => "int", "Required" => true, "Multiple" => false, "Default" => 8, "Options" => null, ), "param2" => array( "Name" => "Parameter 2", "Description" => "", "Type" => "select", "Required" => false, "Multiple" => true, "Default" => "v2", "Options" => array( "v1" => "V 1", "v2" => "V 2", "v3" => "V 3", . . . ), ), . . . ) STATE_PARAMETERS example: array( array( "NAME" => event_name, "TITLE" => event_title, "PERMISSION" => array('user_1') ), . . . ) STATE_PERMISSIONS example: array( operation => users_array, . . . )

Аргументы
array$documentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE)
null | array$documentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
Возвращает
array - Workflow states and templates.

См. определение в файле document.php строка 108

◆ getNumberOfWorkflowTemplatesForDocumentType()

getNumberOfWorkflowTemplatesForDocumentType ( $documentType)
static

См. определение в файле document.php строка 1316

◆ getTaskControls()

getTaskControls ( $arTask,
$userId = 0 )
static

См. определение в файле document.php строка 832

◆ getTemplatesForStart()

getTemplatesForStart ( $userId,
$documentType,
$documentId = null,
array $parameters = array() )
static

См. определение в файле document.php строка 1747

◆ getUserGroups()

getUserGroups ( array $parameterDocumentType,
array $parameterDocumentId,
int $userId )
static

См. определение в файле document.php строка 1806

◆ getUserTasksForWorkflow()

getUserTasksForWorkflow ( $userId,
$workflowId )
static

Method returns task array for specified user and specified workflow state. Return array example: array( array( "ID" => task_id, "NAME" => task_name, "DESCRIPTION" => task_description, ), . . . )

Аргументы
int$userId- User id.
string$workflowId- Workflow id.
Возвращает
array - Tasks.

См. определение в файле document.php строка 1510

◆ getWorkflowTemplatesForDocumentType()

getWorkflowTemplatesForDocumentType ( $documentType,
$showSystemTemplates = true )
static

Method returns array of workflow templates for specified document type. Return array example: array( array( "ID" => workflow_id, "NAME" => template_name, "DESCRIPTION" => template_description, "MODIFIED" => modified datetime, "USER_ID" => modified by user id, "USER_NAME" => modified by user name, "AUTO_EXECUTE" => flag CBPDocumentEventType, "AUTO_EXECUTE_TEXT" => auto_execute_text, ), . . . )

Аргументы
array$documentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
bool$showSystemTemplatesShows system templates.
Возвращает
array - Templates array.

См. определение в файле document.php строка 1257

◆ isAdmin()

isAdmin ( )
static

См. определение в файле document.php строка 1540

◆ isExpression()

isExpression ( $value)
static

Bizproc expression checker. Required for usage from external modules! Examples: {=Document:IBLOCK_ID}, {=Document:CREATED_BY>printable}, {=SequentialWorkflowActivity1:DocumentApprovers>user,printable}

Аргументы
$value
Возвращает
bool

См. определение в файле document.php строка 1667

◆ killWorkflow()

killWorkflow ( $workflowId,
$terminate = true,
$documentId = null )
static

См. определение в файле document.php строка 566

◆ mergeDocuments()

mergeDocuments ( $firstDocumentId,
$secondDocumentId )
static

См. определение в файле document.php строка 154

◆ migrateDocumentType()

migrateDocumentType ( $oldType,
$newType )
static

См. определение в файле document.php строка 24

◆ onAfterTMDayStart()

onAfterTMDayStart ( $data)
static

См. определение в файле document.php строка 1588

◆ onDocumentDelete()

onDocumentDelete ( $documentId,
& $errors )
static

Method removes all related document data.

Аргументы
array$documentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
array$errors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).

См. определение в файле document.php строка 597

◆ parseExpression()

parseExpression ( $expression)
static

См. определение в файле document.php строка 1673

◆ postTaskForm()

postTaskForm ( $arTask,
$userId,
$arRequest,
& $arErrors,
$userName = "" )
static

См. определение в файле document.php строка 624

◆ prepareFileForHistory()

prepareFileForHistory ( $documentId,
$fileId,
$historyIndex )
static

См. определение в файле document.php строка 1535

◆ sendB24LimitsNotifyToAdmins()

sendB24LimitsNotifyToAdmins ( )
static
Возвращает
string

См. определение в файле document.php строка 1633

◆ sendExternalEvent()

sendExternalEvent ( $workflowId,
$workflowEvent,
$arParameters,
& $arErrors )
static

Method sends external event to workflow.

Аргументы
string$workflowId- Workflow id.
string$workflowEvent- Event name.
array$arParameters- Event parameters.
array$arErrors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).

См. определение в файле document.php строка 511

◆ setTasksUserStatus()

setTasksUserStatus ( $userId,
$status,
$ids = array(),
& $errors = array() )
static
Аргументы
int$userIdTask User Id.
int$statusTask user status.
int | array$idsTask ids.
array$errorsError collection.
Возвращает
bool

См. определение в файле document.php строка 681

◆ showParameterField()

showParameterField ( $type,
$name,
$values,
$arParams = Array() )
static

См. определение в файле document.php строка 1092

◆ showTaskForm()

showTaskForm ( $arTask,
$userId,
$userName = "",
$arRequest = null )
static

См. определение в файле document.php строка 660

◆ signDocumentType()

signDocumentType ( array $documentType)
static

См. определение в файле document.php строка 1707

◆ signParameters()

signParameters ( array $parameters)
static

См. определение в файле document.php строка 1693

◆ startDebugWorkflow()

startDebugWorkflow ( $workflowTemplateId,
$documentId,
$parameters,
& $errors )
static

См. определение в файле document.php строка 363

◆ startWorkflow()

startWorkflow ( $workflowTemplateId,
$documentId,
$parameters,
& $errors,
$parentWorkflow = null )
static

Method starts workflow.

Аргументы
int$workflowTemplateId- Template id.
array$documentId- Document id array(MODULE_ID, ENTITY, DOCUMENT_ID).
array$parameters- Workflow parameters.
array$errors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).
array | null$parentWorkflow- Parent workflow information.
Возвращает
string - Workflow id.

См. определение в файле document.php строка 339

◆ startWorkflowParametersShow()

startWorkflowParametersShow ( $templateId,
$arWorkflowParameters,
$formName,
$bVarsFromForm,
$documentType = null )
static

Method shows parameters form. Validates in StartWorkflowParametersValidate.

Аргументы
int$templateId- Template id.
array$arWorkflowParameters- Workflow parameters.
string$formName- Form name.
bool$bVarsFromForm- false on first form open, else - true.
null | array$documentTypeDocument type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).

См. определение в файле document.php строка 927

◆ startWorkflowParametersValidate()

startWorkflowParametersValidate ( $templateId,
$arWorkflowParameters,
$documentType,
& $arErrors )
static

Method validates parameters values from StartWorkflowParametersShow.

Аргументы
int$templateId- Template id.
array$arWorkflowParameters- Workflow parameters.
$documentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
array$arErrors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).
Возвращает
array - Valid Parameters values.

См. определение в файле document.php строка 853

◆ terminateWorkflow()

terminateWorkflow ( $workflowId,
$documentId,
& $arErrors,
$stateTitle = '' )
static

Method terminates workflow.

Аргументы
string$workflowId- Workflow id.
array$documentId- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
array$arErrors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).
string$stateTitle- State title (workflow status).

См. определение в файле document.php строка 537

◆ unSignDocumentType()

unSignDocumentType ( $unsignedData)
static
Аргументы
string$unsignedData
Возвращает
array|null Document type.

См. определение в файле document.php строка 1716

◆ unSignParameters()

unSignParameters ( $unsignedData)
static
Аргументы
string$unsignedData
Возвращает
array

См. определение в файле document.php строка 1702

◆ updateWorkflowTemplate()

updateWorkflowTemplate ( $id,
$documentType,
$arFields,
& $arErrors )
static

Method updates workflow template.

Аргументы
int$id- Template id.
array$documentType- Document type array(MODULE_ID, ENTITY, DOCUMENT_TYPE).
array$arFields- Data for update.
array$arErrors- Errors array(array("code" => error_code, "message" => message, "file" => file_path), ...).

См. определение в файле document.php строка 1377

Поля

◆ PARAM_DOCUMENT_EVENT_TYPE

const PARAM_DOCUMENT_EVENT_TYPE = 'DocumentEventType'

См. определение в файле document.php строка 19

◆ PARAM_DOCUMENT_TYPE

const PARAM_DOCUMENT_TYPE = '__DocumentType'

См. определение в файле document.php строка 20

◆ PARAM_IGNORE_SIMULTANEOUS_PROCESSES_LIMIT

const PARAM_IGNORE_SIMULTANEOUS_PROCESSES_LIMIT = 'IgnoreSimultaneousProcessesLimit'

См. определение в файле document.php строка 18

◆ PARAM_MODIFIED_DOCUMENT_FIELDS

const PARAM_MODIFIED_DOCUMENT_FIELDS = 'ModifiedDocumentField'

См. определение в файле document.php строка 16

◆ PARAM_PRE_GENERATED_WORKFLOW_ID

const PARAM_PRE_GENERATED_WORKFLOW_ID = 'PreGeneratedWorkflowId'

См. определение в файле document.php строка 21

◆ PARAM_TAGRET_USER

const PARAM_TAGRET_USER = 'TargetUser'

См. определение в файле document.php строка 15

◆ PARAM_USE_FORCED_TRACKING

const PARAM_USE_FORCED_TRACKING = 'UseForcedTracking'

См. определение в файле document.php строка 17

◆ PARAM_USED_DOCUMENT_FIELDS

const PARAM_USED_DOCUMENT_FIELDS = 'UsedDocumentField'

См. определение в файле document.php строка 22


Объявления и описания членов класса находятся в файле: