19 declare(strict_types=1);
37 $DIC->resourceStorage()->collection()->id()
44 $this->filtered_amount_of_items = (
int)$this->db->fetchAssoc(
$r)[
'cnt'];
49 while (
$d = $this->db->fetchAssoc(
$r)) {
50 $rid_strings[] =
$d[
'rid'] ??
'';
52 $this->irss->preload($rid_strings);
53 foreach ($rid_strings as $rid_string) {
54 $rid_instance = $this->irss->manage()->find($rid_string);
58 $this->collection->add($rid_instance);
82 $r = $this->db->query(
'SELECT DISTINCT * FROM il_resource_stkh');
83 while (
$d = $this->db->fetchAssoc(
$r)) {
84 $class_name =
$d[
'class_name'] ??
'';
85 if (!class_exists($class_name)) {
89 $stakeholder =
new $class_name();
91 $stakeholders[
$d[
'id']] = $stakeholder->getConsumerNameForPresentation();
97 'title' => $ui_factory->
input()->field()->text(
100 'size' => $ui_factory->
input()->field()->numeric(
101 $lng->
txt(
'file_size_bigger_than')
103 'stakeholder' => $ui_factory->
input()->field()->select(
104 $lng->
txt(
'stakeholders'),
130 $q .=
" FROM il_resource_revision 131 JOIN il_resource_info ON il_resource_revision.rid = il_resource_info.rid AND 132 il_resource_info.version_number = il_resource_revision.version_number 133 JOIN il_resource_stkh_u ON il_resource_revision.rid = il_resource_stkh_u.rid";
139 $q .=
" GROUP BY il_resource_revision.rid ";
161 return "SELECT COUNT(il_resource_revision.rid) AS cnt";
164 return "SELECT il_resource_revision.rid 165 , MAX(il_resource_revision.version_number) AS max_revision 166 , il_resource_revision.title AS revision_title 167 , il_resource_info.title AS file_title 168 , il_resource_info.size AS file_size 169 , il_resource_info.creation_date AS creation_date 170 , il_resource_stkh_u.stakeholder_id AS stakeholder";
178 if ($this->filter_values !== null) {
179 if (isset($this->filter_values[
'title']) && $this->filter_values[
'title'] !==
'') {
180 $filter_values[] = $this->db->quote(
"%" . $this->filter_values[
'title'] .
"%",
'text');
181 $filters[] =
" il_resource_revision.title LIKE %s ";
183 if (isset($this->filter_values[
'size']) && $this->filter_values[
'size'] !==
'') {
186 $filters[] =
" il_resource_info.size > %s ";
189 if (isset($this->filter_values[
'stakeholder']) && $this->filter_values[
'stakeholder'] !==
'') {
190 $filter_values[] = $this->db->quote(
"" . $this->filter_values[
'stakeholder'] .
"",
'text');
191 $filters[] =
" il_resource_stkh_u.stakeholder_id = %s ";
194 if ($filters !== []) {
195 $query =
" WHERE " . implode(
" AND ", $filters);
206 if ($this->filter_values !== null) {
207 if (isset($this->filter_values[
'revisions']) && $this->filter_values[
'revisions'] !==
'') {
208 $filter_values[] = $this->db->quote($this->filter_values[
'revisions'],
'integer');
209 $filters[] =
"MAX(il_resource_revision.version_number) > %s ";
212 if ($filters !== []) {
213 $query =
" HAVING " . implode(
" AND ", $filters);
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
Interface Observer Contains several chained tasks and infos about them.
input()
description: purpose: > In opposite to components with a purely receptive or at most navigational ch...
const BY_CREATION_DATE_DESC
buildSelect(bool $count_only)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This is how the factory for UI elements looks.
getFilterItems(Factory $ui_factory, \ilLanguage $lng)
Class ResourceIdentification.
const BY_CREATION_DATE_ASC
__construct(Container $dic, ilPlugin $plugin)
getBaseQuery(bool $count_only)