19 declare(strict_types=1);
30 'tos_acceptance_track.tosv_id',
31 'tos_acceptance_track.criteria',
32 'tos_acceptance_track.ts',
37 '(CASE WHEN tos_documents.title IS NOT NULL THEN tos_documents.title ELSE tos_versions.title END) title',
41 return implode(
', ', $fields);
47 'INNER JOIN tos_acceptance_track ON tos_acceptance_track.usr_id = ud.usr_id',
48 'INNER JOIN tos_versions ON tos_versions.id = tos_acceptance_track.tosv_id',
49 'LEFT JOIN tos_documents ON tos_documents.id = tos_versions.doc_id',
52 return 'usr_data ud ' . implode(
' ', $joins);
59 if (isset($filter[
'query']) && is_string($filter[
'query']) && $filter[
'query'] !==
'') {
60 $where[] =
'(' . implode(
' OR ', [
61 $this->db->like(
'ud.login',
'text',
'%' . $filter[
'query'] .
'%'),
62 $this->db->like(
'ud.firstname',
'text',
'%' . $filter[
'query'] .
'%'),
63 $this->db->like(
'ud.lastname',
'text',
'%' . $filter[
'query'] .
'%'),
64 $this->db->like(
'ud.email',
'text',
'%' . $filter[
'query'] .
'%')
68 if (isset($filter[
'period']) && is_array($filter[
'period'])) {
69 $dateFilterParts = [];
71 if (null !== $filter[
'period'][
'start']) {
72 $dateFilterParts[] =
'tos_acceptance_track.ts >= ' . $this->db->quote(
73 $filter[
'period'][
'start'],
78 if (null !== $filter[
'period'][
'end']) {
79 $dateFilterParts[] =
'tos_acceptance_track.ts <= ' . $this->db->quote(
80 $filter[
'period'][
'end'],
85 if (count($dateFilterParts) > 0) {
86 $where[] =
'(' . implode(
' AND ', $dateFilterParts) .
')';
90 return implode(
' AND ', $where);
105 if (isset($params[
'order_field'])) {
106 if (!is_string($params[
'order_field'])) {
110 if (in_array($params[
'order_field'], [
'lng',
'src'])) {
112 $params[
'order_field'] =
'ts';
115 if (!in_array($params[
'order_field'], [
'login',
'firstname',
'lastname',
'title',
'ts'])) {
119 if ($params[
'order_field'] ===
'ts') {
120 $params[
'order_field'] =
'tos_acceptance_track.ts';
123 if (!isset($params[
'order_direction'])) {
124 $params[
'order_direction'] =
'ASC';
125 } elseif (!in_array(strtolower($params[
'order_direction']), [
'asc',
'desc'])) {
129 return $params[
'order_field'] .
' ' . $params[
'order_direction'];
Class ilTermsOfServiceAcceptanceHistoryProvider.
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
getOrderByPart(array $params, array $filter)
getGroupByPart(array $params, array $filter)
getWherePart(array $params, array $filter)
getSelectPart(array $params, array $filter)
getFromPart(array $params, array $filter)
Class ilTermsOfServiceTableDatabaseDataProvider.
getHavingPart(array $params, array $filter)