1
0
mirror of https://github.com/nerzhul/ocsms.git synced 2025-06-07 16:06:15 +00:00

SQL query syntax fix

This commit is contained in:
Loic Blot 2015-01-09 19:01:51 +00:00
parent c5a9324305
commit f76a376635
3 changed files with 10 additions and 6 deletions

View File

@ -47,7 +47,7 @@ class ConfigMapper extends Mapper {
public function hasKey ($key, $value){ public function hasKey ($key, $value){
try { try {
$sql = "SELECT key FROM `*PREFIX*ocsms_config` WHERE `key` = ? AND `user` = ?"; $sql = "SELECT `key` FROM `*PREFIX*ocsms_config` WHERE `key` = ? AND `user` = ?";
$this->findEntity($sql, array($key, $this->user)); $this->findEntity($sql, array($key, $this->user));
return true; return true;
} catch (DoesNotExistException $e){ } catch (DoesNotExistException $e){
@ -57,7 +57,7 @@ class ConfigMapper extends Mapper {
public function getKey ($key) { public function getKey ($key) {
try { try {
$query = \OCP\DB::prepare("SELECT value FROM `*PREFIX*ocsms_config` WHERE `key` = ? AND `user` = ?"); $query = \OCP\DB::prepare("SELECT `value` FROM `*PREFIX*ocsms_config` WHERE `key` = ? AND `user` = ?");
$result = $query->execute(array($key, $this->user)); $result = $query->execute(array($key, $this->user));
while($row = $result->fetchRow()) { while($row = $result->fetchRow()) {
return $this->crypto->decrypt($row["value"]); return $this->crypto->decrypt($row["value"]);

View File

@ -33,7 +33,11 @@ app.controller('SettingsController', ['$scope',
} }
]); ]);
app.controller('ContactsController' ['$scope', function ($scope) { app.controller('ContactsController' ['$scope',
function ($scope) {
$scope.loadConversation = function () {
alert('loadConversation');
};
} }
]); ]);
@ -112,7 +116,7 @@ var checkNewMessages = function() {
if (typeof jsondata['photos'][peerLabel] != 'undefined') { if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"'; peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
} }
peerListBuf += '></div><a href="#" mailbox-navigation="' + idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>'; peerListBuf += '></div><a href="#" ng-click="loadConversation();" mailbox-navigation="' + idxVal2 + '" style="font-weight: bold;" mailbox-label="' + peerLabel + '">' + peerLabel + ' (' + val + ')</a></li>';
$('#app-mailbox-peers ul').prepend(peerListBuf); $('#app-mailbox-peers ul').prepend(peerListBuf);
bufferedContacts.push(peerLabel); bufferedContacts.push(peerLabel);
@ -316,7 +320,7 @@ function fetchInitialPeerList(jsondata) {
if (typeof jsondata['photos'][peerLabel] != 'undefined') { if (typeof jsondata['photos'][peerLabel] != 'undefined') {
peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"'; peerListBuf += 'style="background-image: url(' + jsondata['photos'][peerLabel] + ');"';
} }
peerListBuf += '></div><a href="#" mailbox-navigation="' + idxVal2 + '" mailbox-label="' + peerLabel + '">' + peerLabel + '</a></li>'; peerListBuf += '></div><a href="#" ng-click="loadConversation();" mailbox-navigation="' + idxVal2 + '" mailbox-label="' + peerLabel + '">' + peerLabel + '</a></li>';
bufferedContacts.push(peerLabel); bufferedContacts.push(peerLabel);
} }
}); });

View File

@ -9,7 +9,7 @@ use \OCA\OcSms\Lib\CountryCodes;
<div class="ng-scope" id="app" ng-app="OcSms"> <div class="ng-scope" id="app" ng-app="OcSms">
<div id="app-mailbox-peers"> <div id="app-mailbox-peers">
<ul> <ul ng-controller="ContactsController">
<li><div id="ocsms-empty-peers">There isn't any conversation</div></li> <li><div id="ocsms-empty-peers">There isn't any conversation</div></li>
</ul> </ul>
</div> </div>