4include_once
'Services/User/classes/class.ilUserAutoComplete.php';
5require_once
'Services/Mail/classes/class.ilMailAutoCompleteRecipientProvider.php';
27 $this->
data = $this->db->fetchAssoc($this->res);
29 return is_array($this->
data);
39 'login' => $this->
data[
'login'],
40 'firstname' => $this->
data[
'firstname'],
41 'lastname' => $this->
data[
'lastname']
51 return $this->
data[
'login'];
60 $this->db->free($this->res);
66 $query = implode(
" ", array(
67 'SELECT ' . $select_part,
69 $where_part ?
'WHERE ' . $where_part :
'',
70 $order_by_part ?
'ORDER BY ' . $order_by_part :
''
73 $this->res = $this->db->query(
$query);
84 "(CASE WHEN (profpref.value = %s OR profpref.value = %s OR profpref.value IS NULL) THEN firstname ELSE '' END) firstname",
85 $this->db->quote(
'y',
'text'),
86 $this->db->quote(
'g',
'text')
89 "(CASE WHEN (profpref.value = %s OR profpref.value = %s OR profpref.value IS NULL) THEN lastname ELSE '' END) lastname",
90 $this->db->quote(
'y',
'text'),
91 $this->db->quote(
'g',
'text')
94 "(CASE WHEN ((profpref.value = %s OR profpref.value = %s OR profpref.value IS NULL) AND pubemail.value = %s) THEN email ELSE '' END) email",
95 $this->db->quote(
'y',
'text'),
96 $this->db->quote(
'g',
'text'),
97 $this->db->quote(
'y',
'text')
101 $fields[] =
'profpref.value profile_value';
102 $fields[] =
'pubemail.value email_value';
104 return implode(
', ', $fields);
115 LEFT JOIN usr_pref profpref
116 ON profpref.usr_id = usr_data.usr_id
117 AND profpref.keyword = ' . $this->db->quote(
'public_profile',
'text');
120 LEFT JOIN usr_pref pubemail
121 ON pubemail.usr_id = usr_data.usr_id
122 AND pubemail.keyword = ' . $this->db->quote(
'public_email',
'text');
125 return 'usr_data ' . implode(
' ', $joins);
137 $outer_conditions = array();
138 $outer_conditions[] =
'usr_data.usr_id != ' . $this->db->quote(ANONYMOUS_USER_ID,
'integer');
140 $field_conditions = array();
144 if (
'email' == $field) {
147 $email_query = array();
148 $email_query[] = $field_condition;
149 $email_query[] =
'pubemail.value = ' . $this->db->quote(
'y',
'text');
150 $field_conditions[] =
'(' . implode(
' AND ', $email_query) .
')';
152 $field_conditions[] = $field_condition;
160 if ($field_conditions) {
161 $fields =
'(' . implode(
' OR ', $field_conditions) .
')';
163 $field_conditions = [
'(' . implode(
' AND ', array(
165 $this->db->in(
'profpref.value', array(
'y',
'g'),
false,
'text')
173 include_once
'Services/User/classes/class.ilUserAccountSettings.php';
175 include_once
'./Services/User/classes/class.ilUserFilter.php';
179 if ($field_conditions) {
180 $outer_conditions[] =
'(' . implode(
' OR ', $field_conditions) .
')';
183 return implode(
' AND ', $outer_conditions);
201 return $this->db->like($field,
'text', $a_str .
'%');
210 $available_fields = array();
211 foreach (array(
'firstname',
'lastname') as $field) {
212 include_once
'Services/Search/classes/class.ilUserSearchOptions.php';
214 $available_fields[] = $field;
217 return $available_fields;
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
Class ilMailAutoCompleteRecipientProvider.
Class ilMailAutoCompleteUserProvider.
getFields()
Get searchable fields.
rewind()
"Rewind "implementation of iterator interface
key()
"Key" implementation of iterator interface
getQueryConditionByFieldAndValue($field, $a_str)
current()
"Current" implementation of iterator interface
getWherePart($search_query)
__construct($quoted_term, $term)
valid()
"Valid" implementation of iterator interface
static getInstance()
Singelton get instance.
static getInstance()
Singelton get instance.
static _isEnabled($a_key)