* evaluate if the user did filter in the report and if he is allowed to filter (shared reports) * * @param $metadata * @param $filteroptions * @param $dataoptions * @param $chartoptions * @param $tableoptions * @return mixed */
($metadata, $filteroptions, $dataoptions, $chartoptions, $tableoptions, ?string $chart = null, ?string $visualization = null)
| 421 | * @return mixed |
| 422 | */ |
| 423 | private function evaluateCanFilter($metadata, $filteroptions, $dataoptions, $chartoptions, $tableoptions, ?string $chart = null, ?string $visualization = null) { |
| 424 | // send current user filter options to the data request |
| 425 | // only if the report has update-permissions |
| 426 | // if nothing is changed by the user, the filter which is stored for the report, will be used |
| 427 | if ($filteroptions and $filteroptions !== '' and (int)$metadata['permissions'] === Constants::PERMISSION_UPDATE) { |
| 428 | $metadata['filteroptions'] = $filteroptions; |
| 429 | $metadata['dataoptions'] = $dataoptions; |
| 430 | $metadata['chartoptions'] = $chartoptions; |
| 431 | $metadata['tableoptions'] = $tableoptions; |
| 432 | if ($visualization !== null && in_array($visualization, ['chart', 'table', 'ct'], true)) { |
| 433 | $metadata['visualization'] = $visualization; |
| 434 | } |
| 435 | if ($chart !== null) { |
| 436 | $metadata['chart'] = $chart; |
| 437 | } |
| 438 | } |
| 439 | return $metadata; |
| 440 | } |
| 441 | |
| 442 | |
| 443 | /** |
no outgoing calls
no test coverage detected