- Модуль: tasks
- Путь к файлу: ~/bitrix/modules/tasks/classes/general/task.php
- Класс: CTasks
- Вызов: CTasks::makeAccessFilterRuntimeOptions
static function makeAccessFilterRuntimeOptions($filter, $parameters)
{
$runtimeOptions = [
'FIELDS' => [],
'FILTERS' => [],
];
$fields = [
// ROLES
'CREATED_BY' => true,
'RESPONSIBLE_ID' => true,
'ACCOMPLICE' => true,
'AUDITOR' => true,
'ROLEID' => true,
// TASK FIELDS
'ID' => true,
'TITLE' => true,
'PRIORITY' => true,
'STATUS' => true,
'GROUP_ID' => true,
'TAG' => true,
'MARK' => true,
'ALLOW_TIME_TRACKING' => true,
// DATES
'DEADLINE' => true,
'CREATED_DATE' => true,
'CLOSED_DATE' => true,
'DATE_START' => true,
'START_DATE_PLAN' => true,
'END_DATE_PLAN' => true,
// DIFFICULT PARAMS
'ACTIVE' => true,
'PARAMS' => true,
'PROBLEM' => true,
];
if (is_array($filter) && !empty($filter))
{
foreach ($filter as $key => $value)
{
$newKey =
mb_substr((string)$key, 0, 12) === '::SUBFILTER-'
? mb_substr((string)$key, 12)
: null
;
if ($newKey && ($fields[$newKey] ?? null))
{
$fieldRuntimeOptions = static::getFieldRuntimeOptions($newKey, $value, $parameters);
$runtimeOptions['FIELDS'] = array_merge($runtimeOptions['FIELDS'], $fieldRuntimeOptions['FIELDS']);
$runtimeOptions['FILTERS'] = array_merge($runtimeOptions['FILTERS'],
$fieldRuntimeOptions['FILTERS']);
}
}
}
return $runtimeOptions;
}