/**
  * @return array
  * @version 2015062901
  * @since 2015062901
  */
 private function getAllPhoneNumbers()
 {
     $numbers = array();
     $contactNumbers = $this->addressbookDAO->getPhonenumbersOfAllContacts();
     $users = $this->userDAO->getAllUsers();
     foreach ($contactNumbers as $number) {
         $numbers[] = $number;
     }
     foreach ($users as $user) {
         if ($user->getRecipientNumber() != NULL && $user->getRecipientNumber()->getPhoneNumber() != NULL) {
             $numbers[] = $user->getRecipientNumber()->getPhoneNumber();
         }
     }
     return array_unique($numbers);
 }
Beispiel #2
0
$table->is_downloadable(true);
$table->show_download_buttons_at(array(TABLE_P_BOTTOM));
$table->setup();
// BEGIN PAGE OUTPUT
if (!$table->is_downloading()) {
    // Drop in page header
    echo $output->header();
    echo $output->box($sentMessagesDAO->countMessagesSent() . get_string('sentnoticefrag1', 'block_moodletxt') . $sentMessagesDAO->countMessageRecipients() . get_string('sentnoticefrag2', 'block_moodletxt') . html_writer::empty_tag('br') . $sentMessagesDAO->countMessagesSent(0, $userToView) . get_string('sentnoticefrag3', 'block_moodletxt'));
    // Show select box allow user to show/hide event-generated messages
    $eventSelect = new single_select(new moodle_url('sent.php', array('course' => $courseId, 'instance' => $instanceId, 'user' => $userToView)), 'events', array(TxttoolsSentMessageDAO::$EVENT_QUERY_DISCARD => get_string('optioneventhide', 'block_moodletxt'), TxttoolsSentMessageDAO::$EVENT_QUERY_INCLUDE => get_string('optioneventshow', 'block_moodletxt'), TxttoolsSentMessageDAO::$EVENT_QUERY_EXCLUSIVE => get_string('optioneventonly', 'block_moodletxt')), $includeEvents, false);
    $eventSelect->set_label(get_string('labelshowmessagebygenerator', 'block_moodletxt'));
    echo $output->render($eventSelect);
    // Show user list if the user has permission to see other people's messages
    if ($canAdminUsers) {
        $optionSet = array(0 => get_string('optionallusers', 'block_moodletxt'));
        $userList = $userDAO->getAllUsers();
        foreach ($userList as $userObj) {
            $optionSet[$userObj->getId()] = $userObj->getFullNameForDisplay();
        }
        $userSelect = new single_select(new moodle_url('sent.php', array('course' => $courseId, 'instance' => $instanceId, 'events' => $includeEvents)), 'user', $optionSet, $userToView, false);
        $userSelect->set_label(get_string('labelshowmessagesforuser', 'block_moodletxt'));
        echo $output->render($userSelect);
    }
}
// Figure out which table item the user wants to sort by
$orderBy = '';
foreach ($table->get_sort_columns() as $field => $direction) {
    switch ($field) {
        case 'user':
            $databaseOrder = 'u.lastname %DIR%, u.firstname %DIR%';
            break;