Documentation

GetList

CDBResult
CTaskTemplates::GetList(
 array arOrder = array(),
 array arFilter = array(),
 array arNavParams = array(),
 array arParams = array(),
 array arSelect = array()
);

Returns list of templates by the arFilter filter, sorted in the arOrder direction.

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

Method parameters

Parameter Description Available from version
arOrder Array for results sorting. Array of array("sorting field"=>"sorting direction" [, ...]) type.
Field for sorting can have the following values:
  • TITLE - task name;
  • CREATED_BY - task creator; 
  • RESPONSIBLE_ID - responsible; 
  • GROUP_ID - workgroup. 
Sorting direction can have the following values:
  • asc - by ascension;
  • desc - by descension;
    Optional. By default, filtering is done by descension of template ID.
arFilter Array of the array("filtered field"=>"filter value" [, ...]). Filtered field can have the following values:
  • ID - template ID;
  • TASK_ID - task ID;
  • CREATED_BY - task creator;
  • PRIORITY - priority;
  • RESPONSIBLE - responsible;
  • TITLE - task name (can be searched by the template [%_]) ;
Type of filtration can be specified in front of the name of filtered field:
  • "!" - not equal
  • "<" - less
  • "<=" - less or equal
  • ">" - more
  • ">=" - more or equal

"filter values" - single value or an array.

Optional. By default, records are not filtered.
arNavParams Array of parameters for page-by-page navigation. Optional.
arParams Array of additional parameters. Accepts the USER_ID key with specified user ID, on behalf of which the access permission rights will be verified when selecting task templates. Optional.
arSelect Array of selected fields. If an empty array is specified (by default) - then all fields will be selected. Optional.

Returned value

CDBResult object is returned. 

Examples of use

<?

// Select all templates for user with ID = 2
if (CModule::IncludeModule("tasks"))
{
$res = CTaskTemplates::GetList(
Array("TITLE" => "ASC"),
Array("RESPONSIBLE" => "2")
);

while ($arTemplate = $res->GetNext())
{
echo "Template name: ".$arTemplate["TITLE"]."<br>";
}
}

?>


© «Bitrix24», 2001-2024