1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-10 21:24:33 +01:00
This commit is contained in:
LEDfan 2014-09-25 08:08:50 +02:00
parent 2bf76c213c
commit 5e714a7e8e
3 changed files with 8 additions and 3 deletions

View File

@ -217,7 +217,7 @@ OC.notify = function(params) {
if(!contacts_properties_indexed) {
// Wait a couple of mins then check if contacts are indexed.
setTimeout(function() {
$.when($.post(OC.generateUrl('apps/contacts/indexproperties/{user}/')))
$.when($.post(OC.generateUrl('apps/contacts/indexproperties/{user}/', {user: OC.currentUser})))
.then(function(response) {
if(!response.isIndexed) {
OC.notify({message:t('contacts', 'Indexing contacts'), timeout:20});

View File

@ -91,8 +91,8 @@ class AddressbookProvider implements \OCP\IAddressBook {
public function search($pattern, $searchProperties, $options) {
$ids = array();
$results = array();
$query = 'SELECT DISTINCT `contactid` FROM `' . self::PROPERTY_TABLE . '` WHERE (';
$params = array();
$query = 'SELECT DISTINCT `contactid` FROM `' . self::PROPERTY_TABLE . '` WHERE `userid` = ? AND (';
$params = array(\OCP\User::getUser());
foreach($searchProperties as $property) {
$params[] = $property;
$params[] = '%' . $pattern . '%';

View File

@ -204,6 +204,11 @@ class Hooks{
}
$offset += $limit;
}
$stmt = OCP\DB::prepare('DELETE FROM `*PREFIX*contacts_cards_properties`
WHERE NOT EXISTS(SELECT NULL
FROM `*PREFIX*contacts_cards`
WHERE `*PREFIX*contacts_cards`.id = `*PREFIX*contacts_cards_properties`.contactid)');
$result = $stmt->execute(array());
}
public static function getCalenderSources($parameters) {