|
| addResult ($login, $firstname, $lastname, $type) |
| Adds a result for mail recipient auto complete. More...
|
|
- Author
- Nadia Krzywon
- Version
- $Id$
Definition at line 8 of file class.ilMailForm.php.
◆ __construct()
ilMailForm::__construct |
( |
| ) |
|
Constructor.
public
Definition at line 23 of file class.ilMailForm.php.
References $ilUser.
27 $this->allow_smtp = $rbacsystem->checkAccess(
'smtp_mail', MAIL_SETTINGS_ID);
28 $this->user_id = $ilUser->getId();
30 $this->result = array();
◆ addResult()
ilMailForm::addResult |
( |
|
$login, |
|
|
|
$firstname, |
|
|
|
$lastname, |
|
|
|
$type |
|
) |
| |
|
private |
Adds a result for mail recipient auto complete.
private
- Exceptions
-
Definition at line 41 of file class.ilMailForm.php.
Referenced by getRecipientAsync().
43 if(count($this->result) > $this->max_entries)
48 if (isset($this->setMap[$login]))
51 $tmp =
new stdClass();
55 if($firstname && $lastname)
57 $label .=
" [" . $firstname .
", " . $lastname .
"]";
61 $this->result[] = $tmp;
63 $this->setMap[$login] = 1;
Base class for ILIAS Exception handling.
◆ getRecipientAsync()
ilMailForm::getRecipientAsync |
( |
|
$a_search, |
|
|
|
$a_native_search |
|
) |
| |
Called by class ilMailFormGUI.
- Parameters
-
string | search string surrounded with wildcards |
string | native search string |
- Returns
- stdClass search result as an object of type stdClass public
Definition at line 76 of file class.ilMailForm.php.
References $query, $result, $row, addResult(), ilStr\strPos(), and ilStr\strToLower().
83 abook.firstname firstname, 84 abook.lastname lastname, 86 FROM addressbook abook 87 WHERE abook.user_id = ".$ilDB->quote($this->user_id,
'integer').
" 88 AND abook.login IS NOT NULL 89 AND (". $ilDB->like(
'abook.login',
'text', $a_search).
" 90 OR ".$ilDB->like(
'abook.firstname',
'text', $a_search).
" 91 OR ".$ilDB->like(
'abook.lastname',
'text', $a_search).
" 94 $union_query_1 =
"SELECT DISTINCT 96 abook.firstname firstname, 97 abook.lastname lastname, 99 FROM addressbook abook 100 WHERE abook.user_id = ".$ilDB->quote($this->user_id,
'integer').
" 101 AND abook.login IS NULL 102 AND (".$ilDB->like(
'abook.email',
'text', $a_search).
" 103 OR ".$ilDB->like(
'abook.firstname',
'text', $a_search).
" 104 OR ".$ilDB->like(
'abook.lastname',
'text', $a_search).
" 107 $union_query_2 =
"SELECT DISTINCT 113 WHERE ".$ilDB->like(
'mail.rcp_to',
'text', $a_search).
" 114 AND sender_id = ".$ilDB->quote($this->user_id,
'integer').
" 115 AND mail.sender_id = mail.user_id";
118 'addressbook_1' =>
$query,
119 'mail' => $union_query_2
122 if($this->allow_smtp == 1)
123 $queries[
'addressbook_2'] = $union_query_1;
125 include_once
'Services/Utilities/classes/class.ilStr.php';
130 if($ilDB->getDbType() !=
'oracle')
131 $queries[
'all'] = implode(
' UNION ', $queries);
133 foreach($queries as $type =>
$query)
136 if(
'mail' == $type && $ilDB->getDbType() ==
'oracle')
141 $ilDB->setLimit(0,20);
142 $query_res = $ilDB->query(
$query );
144 while(
$row = $ilDB->fetchObject($query_res))
146 if(
$row->type ==
'mail')
148 if(strpos(
$row->login,
',') || strpos(
$row->login,
';'))
150 $parts = preg_split(
"/[ ]*[;,][ ]*/", trim(
$row->login));
151 foreach($parts as $part)
Base class for ILIAS Exception handling.
static strToLower($a_string)
strPos($a_haystack, $a_needle, $a_offset=NULL)
◆ $allow_smtp
ilMailForm::$allow_smtp = null |
|
private |
◆ $max_entries
ilMailForm::$max_entries = 20 |
|
private |
◆ $result
◆ $setMap
ilMailForm::$setMap = array() |
|
private |
◆ $user_id
ilMailForm::$user_id = null |
|
private |
The documentation for this class was generated from the following file: