Skip to content
This repository has been archived by the owner on Jan 10, 2020. It is now read-only.

Commit

Permalink
Fixing up message sender
Browse files Browse the repository at this point in the history
  • Loading branch information
bassrock committed Jun 4, 2013
1 parent c1896b2 commit 0c0a855
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Controller/PushAdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,10 @@ public function getDeviceListAction() {
$deviceRepository = $em->getRepository('DABSquaredPushBundle:Device');
$deviceName = $this->get('request')->query->get('term');

$devices = $deviceRepository->findAllWithStartName($deviceName);
/** @var $deviceManager \DABSquared\PushNotificationsBundle\Model\DeviceManager */
$deviceManager = $this->get('dab_push_notifications.manager.device');

$devices = $deviceManager->findDeviceWithName($deviceName);
if (empty($devices)) {
$devices = array();
$aDevice['deviceName'] = 'None';
Expand Down
2 changes: 1 addition & 1 deletion Entity/DeviceManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function findDeviceByTypeIdentifierAndAppId($type,$deviceIdentifier, $app
public function findDeviceWithName($searchTerm) {
$qb = $this->repository
->createQueryBuilder('d')
->where('d.deviceName', 'LIKE', '%$searchTerm%');
->where("d.deviceName LIKE '%$searchTerm%'");

$devices = $qb
->getQuery()
Expand Down
26 changes: 24 additions & 2 deletions Resources/views/messagetype.html.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@

{% block mainContent %}
<!DOCTYPE html>
<html xmlns:fb="http://www.facebook.com/2008/fbml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
</head>

<body>

<div class="container" style="padding-top: 60px;">


<form id="pushMessageForm" action="{{ path('create_push_messages') }}" method="post" {{ form_enctype(form) }} autocomplete="off" >

<div class="row" style="text-align:center; width:100%;">
Expand Down Expand Up @@ -36,10 +51,15 @@
</div>
</div>

<div class="row" style="text-align:center;">
<div class="span12">
<input class="btn btn-primary" type="submit" />

<input class="btn btn-primary" type="submit" />
</div>
</div>

</form>
</div>

<script type="text/javascript">
$(document).ready(function(){
Expand All @@ -54,7 +74,7 @@
{
url: "{{ path('get_device_list') }}",
data: {
term: request.term,
term: request.term
},
type: "GET", // a jQuery ajax POST transmits in querystring format in utf-8
dataType: "json", //return data in json format
Expand Down Expand Up @@ -101,6 +121,8 @@
});
</script>
</body>
</html>

{% endblock %}

0 comments on commit 0c0a855

Please sign in to comment.