Skip to content

Commit

Permalink
Query contacts in batches of 20. Possible fix for oc-1126.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghus committed Jul 4, 2012
1 parent 825d92d commit b2eac08
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions apps/contacts/export.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,16 @@
$nl = "\n";
if(isset($bookid)){
$addressbook = OC_Contacts_App::getAddressbook($bookid);
$cardobjects = OC_Contacts_VCard::all($bookid);
//$cardobjects = OC_Contacts_VCard::all($bookid);
header('Content-Type: text/directory');
header('Content-Disposition: inline; filename=' . str_replace(' ', '_', $addressbook['displayname']) . '.vcf');

foreach($cardobjects as $card) {
echo $card['carddata'] . $nl;
$start = 0;
while($cardobjects = OC_Contacts_VCard::all($bookid, $start, 20)){
foreach($cardobjects as $card) {
echo $card['carddata'] . $nl;
}
$start += 20;
}
}elseif(isset($contactid)){
$data = OC_Contacts_App::getContactObject($contactid);
Expand Down

0 comments on commit b2eac08

Please sign in to comment.