diff --git a/addressbook/conv/Import to Addressbook b/addressbook/conv/Import to Addressbook
index 749f4cac19..c43e558010 100644
--- a/addressbook/conv/Import to Addressbook
+++ b/addressbook/conv/Import to Addressbook
@@ -121,17 +121,19 @@
function import_end_file($buffer) {
global $phpgw,$phpgw_info;
-
- //$contacts = CreateObject("phpgwapi.contacts");
- echo '
';
- for ($i=0;$i'.$i.': '.$name.' => '.$value;
- //$contacts->add($phpgw_info["user"]["account_id"],$entry);
- }
- }
- return "Successfully imported $i records into your addressbook.";
+ $contacts = CreateObject("phpgwapi.contacts");
+ echo '
';
+ for ($i=1;$i<=count($buffer);$i++) {
+ while ( list($name,$value) = @each($buffer[$i]) ) {
+ //echo '
'.$i.': '.$name.' => '.$value;
+ $entry[$i][$name] = $value;
+ }
+ //echo '
';
+ $contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
+ }
+ $num = $i - 1;
+ return "Successfully imported $num records into your addressbook.";
}
function import_start_record($buffer) {
@@ -143,6 +145,7 @@
function import_end_record($buffer,$private="private") {
global $phpgw_info;
+ $buffer[$this->id]="";
while ( list($name, $value) = each($this->currentrecord)) {
$buffer[$this->id][$name] = $value;
//echo '
'.$name.' => '.$value;