ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPRGAssignmentFilter Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilPRGAssignmentFilter:

Public Member Functions

 __construct (ilLanguage $lng)
 
 withValues (array $values)
 
 toConditions ()
 
 getItemConfig ()
 

Protected Member Functions

 getCleanedValues ()
 

Protected Attributes

ilLanguage $lng
 
array $values = []
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Definition at line 21 of file ilPRGAssignmentFilter.php.

Constructor & Destructor Documentation

◆ __construct()

ilPRGAssignmentFilter::__construct ( ilLanguage  $lng)

Definition at line 26 of file ilPRGAssignmentFilter.php.

References $lng, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ getCleanedValues()

ilPRGAssignmentFilter::getCleanedValues ( )
protected

Definition at line 100 of file ilPRGAssignmentFilter.php.

References $id, $type, ilTable2GUI\FILTER_CHECKBOX, ilTable2GUI\FILTER_DATE_RANGE, ilTable2GUI\FILTER_SELECT, ilTable2GUI\FILTER_TEXT, getItemConfig(), and ilStudyProgrammeUserTable\OPTION_ALL.

Referenced by toConditions().

100  : array
101  {
102  $ret = [];
103  foreach ($this->getItemConfig() as list($id, $type, $options)) {
104  if (array_key_exists($id, $this->values)) {
106  && (
108  || $this->values[$id] === false
109  )
110  ) {
111  continue;
112  }
114  && $this->values[$id] == ''
115  ) {
116  continue;
117  }
119  && ($this->values[$id] == false || is_null($this->values[$id]))
120  ) {
121  continue;
122  }
124  && $this->values[$id]['from'] == []
125  && $this->values[$id]['to'] == []
126  ) {
127  continue;
128  }
129  $ret[$id] = $this->values[$id];
130  }
131  };
132  return $ret;
133  }
$type
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemConfig()

ilPRGAssignmentFilter::getItemConfig ( )
Returns
array <string $id, string $type, null | array $options>

Definition at line 138 of file ilPRGAssignmentFilter.php.

References ilTable2GUI\FILTER_CHECKBOX, ilTable2GUI\FILTER_DATE_RANGE, ilTable2GUI\FILTER_SELECT, ilTable2GUI\FILTER_TEXT, ILIAS\Repository\lng(), ilStudyProgrammeUserTable\OPTION_ALL, ilStudyProgrammeUserTable\OPTION_USR_ACTIVE, ilStudyProgrammeUserTable\OPTION_USR_INACTIVE, ilPRGAssignmentDBRepository\PROGRESS_FIELD_INVALIDATED, ilPRGAssignmentDBRepository\PROGRESS_FIELD_STATUS, ilPRGAssignmentDBRepository\PROGRESS_FIELD_VQ_DATE, ilPRGProgress\STATUS_ACCREDITED, ilPRGProgress\STATUS_COMPLETED, ilPRGProgress\STATUS_FAILED, ilPRGProgress\STATUS_IN_PROGRESS, ilPRGProgress\STATUS_NOT_RELEVANT, ilStudyProgrammeUserTable\VALIDITY_OPTION_INVALID, and ilStudyProgrammeUserTable\VALIDITY_OPTION_VALID.

Referenced by getCleanedValues().

138  : array
139  {
140  $items = [];
141 
142  $items[] = [
145  [
146  ilStudyProgrammeUserTable::OPTION_ALL => $this->lng->txt("all"),
147  ilStudyProgrammeUserTable::VALIDITY_OPTION_VALID => $this->lng->txt("prg_still_valid"),
148  ilStudyProgrammeUserTable::VALIDITY_OPTION_INVALID => $this->lng->txt("prg_not_valid")
149  ],
150  $this->lng->txt('prg_validity')
151  ];
152 
153  $items[] = [
156  [
157  ilStudyProgrammeUserTable::OPTION_ALL => $this->lng->txt("all"),
158  ilPRGProgress::STATUS_IN_PROGRESS => $this->lng->txt("prg_status_in_progress"),
159  ilPRGProgress::STATUS_COMPLETED => $this->lng->txt("prg_status_completed"),
160  ilPRGProgress::STATUS_ACCREDITED => $this->lng->txt("prg_status_accredited"),
161  ilPRGProgress::STATUS_NOT_RELEVANT => $this->lng->txt("prg_status_not_relevant"),
162  ilPRGProgress::STATUS_FAILED => $this->lng->txt("prg_status_failed")
163  ],
164  ''
165  ];
166 
167  $items[] = ['prg_status_hide_irrelevant', ilTable2GUI::FILTER_CHECKBOX, null, ''];
168 
169  $items[] = [
170  'usr_active',
172  [
173  ilStudyProgrammeUserTable::OPTION_ALL => $this->lng->txt("all"),
174  ilStudyProgrammeUserTable::OPTION_USR_ACTIVE => $this->lng->txt("active_only"),
175  ilStudyProgrammeUserTable::OPTION_USR_INACTIVE => $this->lng->txt("inactive_only")
176  ],
177  ''
178  ];
179 
180  $items[] = ['name', ilTable2GUI::FILTER_TEXT, null, ''];
181 
182  $items[] = [
185  null,
186  ''
187  ];
188 
189  return $items;
190  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ toConditions()

ilPRGAssignmentFilter::toConditions ( )

Definition at line 39 of file ilPRGAssignmentFilter.php.

References getCleanedValues(), IL_CAL_DATE, ilStudyProgrammeUserTable\OPTION_USR_ACTIVE, ilStudyProgrammeUserTable\OPTION_USR_INACTIVE, ilPRGAssignmentDBRepository\PROGRESS_FIELD_INVALIDATED, ilPRGAssignmentDBRepository\PROGRESS_FIELD_STATUS, ilPRGProgress\STATUS_ACCREDITED, ilPRGProgress\STATUS_COMPLETED, ilPRGProgress\STATUS_NOT_RELEVANT, ilStudyProgrammeUserTable\VALIDITY_OPTION_INVALID, and ilStudyProgrammeUserTable\VALIDITY_OPTION_VALID.

39  : array
40  {
41  $conditions = [];
42  foreach ($this->getCleanedValues() as $field => $value) {
43  switch ($field) {
44  case 'status':
45  if ($value) {
46  $conditions[] = ilPRGAssignmentDBRepository::PROGRESS_FIELD_STATUS . '=' . $value;
47  }
48  break;
49  case 'prg_status_hide_irrelevant':
51  break;
52  case 'name':
53  $conditions[] = '('
54  . 'memberdata.firstname LIKE \'%' . $value . '%\' OR' . PHP_EOL
55  . 'memberdata.lastname LIKE \'%' . $value . '%\' OR' . PHP_EOL
56  . 'memberdata.login LIKE \'%' . $value . '%\'' . PHP_EOL
57  . ')';
58  break;
59  case 'invalidated':
62  }
65  $conditions[] = '('
67  . ' OR '
69  . ')';
70  }
71  break;
72 
73  case 'usr_active':
74  if ((int) $value === ilStudyProgrammeUserTable::OPTION_USR_ACTIVE) {
75  $conditions[] = 'memberdata.active = 1';
76  }
78  $conditions[] = 'memberdata.active = 0';
79  }
80  break;
81  case 'vq_date':
82  list($from, $to) = array_values($value);
83  if ($from) {
84  $from = $from->get(IL_CAL_DATE);
85  $conditions[] = 'vq_date >= \'' . $from . ' 00:00:00\'';
86  }
87  if ($to) {
88  $to = $to->get(IL_CAL_DATE);
89  $conditions[] = 'vq_date <= \'' . $to . ' 23:59:59\'';
90  }
91  break;
92 
93  default:
94  throw new ilException("missing field in filter (to condition): " . $field, 1);
95  }
96  }
97  return $conditions;
98  }
const IL_CAL_DATE
+ Here is the call graph for this function:

◆ withValues()

ilPRGAssignmentFilter::withValues ( array  $values)

Definition at line 32 of file ilPRGAssignmentFilter.php.

References $values.

32  : self
33  {
34  $clone = clone $this;
35  $clone->values = $values;
36  return $clone;
37  }

Field Documentation

◆ $lng

ilLanguage ilPRGAssignmentFilter::$lng
protected

Definition at line 23 of file ilPRGAssignmentFilter.php.

Referenced by __construct().

◆ $values

array ilPRGAssignmentFilter::$values = []
protected

Definition at line 24 of file ilPRGAssignmentFilter.php.

Referenced by withValues().


The documentation for this class was generated from the following file: