Documentation

AddMultiple

boolean
CTaskFiles::AddMultiple(
	$taskId,
	array $arFilesIds,
	array $arParams = array()
);

This method attaches several files to a task.

Note: This method accepts an array of configuration parameters and generates scripts, necessary to show file dialog. Static method.

Method parameters

ParameterDescription
$taskIdTask ID.
$arFilesIdsArray of attached files' IDs.
$arParamsArray of parameters (optional argument).

Permissible parameters:
  • CHECK_RIGHTS_ON_FILES — accepts Y/N/true/false. By default - true (Y);
  • USER_ID — user ID, on behalf of which the action is performed (impersonation). By default — current authorized user.

Returned value

Returns true, if all files were successfully attached to the task. Otherwise - false.

Examples of use

<?php
CModule::IncludeModule('tasks');
$taskId = 235;
$arFilesIds = array(34, 35, 36);
$userId = 45;	// Complete operation on behalf of another user
if (!CTaskFiles::AddMultiple($taskId, $arFilesIds, array('USER_ID' => $userId)) )
	AddMessage2Log('Error during file attaching to task ' . $taskId);
?>


© «Bitrix24», 2001-2024
Up