ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilMailAddressbook.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once './Services/Mail/classes/class.ilMailAutoCompleteRecipientResult.php';
5 include_once './Services/Mail/classes/class.ilMailAutoCompleteUserProvider.php';
6 include_once './Services/Mail/classes/class.ilMailAutoCompleteSearch.php';
7 
8 include_once './Services/Mail/classes/class.ilMailAutoCompleteSentMailsRecipientsProvider.php';
9 include_once './Services/Mail/classes/class.ilMailAutoCompleteAddressbookLoginProvider.php';
10 include_once './Services/Mail/classes/class.ilMailAutoCompleteAddressbookEmailProvider.php';
11 include_once './Services/Mail/classes/class.ilMailAutoCompleteProviderEmailFilter.php';
12 
19 {
20  public function getUsersAsync($quoted_term, $term)
21  {
22  $result = new ilMailAutocompleteRecipientResult(
23  isset($_GET['fetchall']) && (int)$_GET['fetchall'] ?
24  ilMailAutocompleteRecipientResult::MODE_FETCH_ALL :
25  ilMailAutocompleteRecipientResult::MODE_STOP_ON_MAX_ENTRIES
26  );
27 
28  $result_fetcher = new ilMailAutoCompleteSearch($result);
29  $result_fetcher->addProvider(new ilMailAutoCompleteUserProvider($quoted_term, $term));
30  $result_fetcher->search();
31 
32  return $result->getItems();
33  }
34 
35  public function getAddressbookAsync($quoted_term, $term)
36  {
37  $address_book_login = new ilMailAutoCompleteAddressbookLoginProvider($quoted_term, $term);
38  $address_book_email = new ilMailAutoCompleteAddressbookEmailProvider($quoted_term, $term);
39 
40  $result = new ilMailAutocompleteRecipientResult(
41  isset($_GET['fetchall']) && (int)$_GET['fetchall'] ?
42  ilMailAutocompleteRecipientResult::MODE_FETCH_ALL :
43  ilMailAutocompleteRecipientResult::MODE_STOP_ON_MAX_ENTRIES
44  );
45 
46  $result_fetcher = new ilMailAutoCompleteSearch($result);
47  $result_fetcher->addProvider($address_book_login);
48  $result_fetcher->addProvider($address_book_email);
49  $result_fetcher->search();
50 
51  return $result->getItems();
52  }
53 
54  public function getEmailsAsync($quoted_term, $term)
55  {
56  $result = new ilMailAutocompleteRecipientResult(
57  isset($_GET['fetchall']) && (int)$_GET['fetchall'] ?
58  ilMailAutocompleteRecipientResult::MODE_FETCH_ALL :
59  ilMailAutocompleteRecipientResult::MODE_STOP_ON_MAX_ENTRIES
60  );
61 
62  $result_fetcher = new ilMailAutoCompleteSearch($result);
63  $result_fetcher->addProvider(new ilMailAutoCompleteProviderEmailFilter(new ilMailAutoCompleteSentMailsRecipientsProvider($quoted_term, $term)));
64  $result_fetcher->search();
65 
66  return $result->getItems();
67  }
68 }