16 'tos_acceptance_track.tosv_id',
17 'tos_acceptance_track.criteria',
18 'tos_acceptance_track.ts',
23 '(CASE WHEN tos_documents.title IS NOT NULL THEN tos_documents.title ELSE tos_versions.title END) title',
27 return implode(
', ', $fields);
36 'INNER JOIN tos_acceptance_track ON tos_acceptance_track.usr_id = ud.usr_id',
37 'INNER JOIN tos_versions ON tos_versions.id = tos_acceptance_track.tosv_id',
38 'LEFT JOIN tos_documents ON tos_documents.id = tos_versions.doc_id',
41 return 'usr_data ud ' . implode(
' ', $joins);
51 if (isset($filter[
'query']) && strlen($filter[
'query'])) {
52 $where[] =
'(' . implode(
' OR ', [
53 $this->db->like(
'ud.login',
'text',
'%' . $filter[
'query'] .
'%'),
54 $this->db->like(
'ud.firstname',
'text',
'%' . $filter[
'query'] .
'%'),
55 $this->db->like(
'ud.lastname',
'text',
'%' . $filter[
'query'] .
'%'),
56 $this->db->like(
'ud.email',
'text',
'%' . $filter[
'query'] .
'%')
60 if (isset($filter[
'period']) && is_array($filter[
'period'])) {
61 $dateFilterParts = [];
63 if (null !== $filter[
'period'][
'start']) {
64 $dateFilterParts[] =
'tos_acceptance_track.ts >= ' . $this->db->quote(
65 $filter[
'period'][
'start'],
70 if (null !== $filter[
'period'][
'end']) {
71 $dateFilterParts[] =
'tos_acceptance_track.ts <= ' . $this->db->quote(
72 $filter[
'period'][
'end'],
77 if (count($dateFilterParts) > 0) {
78 $where[] =
'(' . implode(
' AND ', $dateFilterParts) .
')';
82 return implode(
' AND ', $where);
106 if (isset($params[
'order_field'])) {
107 if (!is_string($params[
'order_field'])) {
111 if (in_array($params[
'order_field'], [
'lng',
'src'])) {
113 $params[
'order_field'] =
'ts';
116 if (!in_array($params[
'order_field'], [
'login',
'firstname',
'lastname',
'title',
'ts'])) {
120 if ($params[
'order_field'] ==
'ts') {
121 $params[
'order_field'] =
'tos_acceptance_track.ts';
124 if (!isset($params[
'order_direction'])) {
125 $params[
'order_direction'] =
'ASC';
127 if (!in_array(strtolower($params[
'order_direction']), [
'asc',
'desc'])) {
132 return $params[
'order_field'] .
' ' . $params[
'order_direction'];
Class ilTermsOfServiceAcceptanceHistoryProvider.
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)