1
0
mirror of https://github.com/nextcloud/ocsms.git synced 2026-08-11 16:32:55 +00:00

Added ajaxCall to get all phone Numbers. Also cleanup templates

This commit is contained in:
Loic Blot
2014-09-16 19:24:20 +00:00
parent 2b4b7ad6d8
commit 37c32f8ce7
4 changed files with 11 additions and 13 deletions
+10 -2
View File
@@ -38,12 +38,10 @@ class SmsController extends Controller {
$mboxes = array(
'PNLConversations' => array(
'label' => 'Conversations',
'phoneNumbers' => $this->smsMapper->getAllPeersPhoneNumbers($this->userId),
'url' => \OCP\Util::linkToAbsolute('index.php', 'apps/ocsms/', array('feed' => 'conversations'))
),
'PNLDrafts' => array(
'label' => 'Drafts',
'phoneNumbers' => array(),
'url' => \OCP\Util::linkToAbsolute('index.php', 'apps/ocsms/', array('feed' => 'drafts'))
)
);
@@ -63,6 +61,16 @@ class SmsController extends Controller {
return new JSONResponse(array("smslist" => $smsList));
}
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function retrieveAllPeers () {
$phoneList = $this->smsMapper->getAllPeersPhoneNumbers($this->userId);
// @ TODO: filter correctly
return new JSONResponse(array("phonelist" => $phoneList));
}
/**
* @NoAdminRequired
*/