diff --git a/addressbook/conv/Import to Addressbook b/addressbook/conv/Import to Addressbook index 9e698ac290..749f4cac19 100644 --- a/addressbook/conv/Import to Addressbook +++ b/addressbook/conv/Import to Addressbook @@ -26,6 +26,7 @@ class import_conv { var $currentrecord = array(); //used for buffering to allow uid lines to go first + var $id; var $import = array( "Title" => "title", @@ -123,30 +124,29 @@ //$contacts = CreateObject("phpgwapi.contacts"); echo '
'; - while ( list($name,$value) = each($buffer) ) { - echo '
'.$name.' => '.$value; - $i++; - //$contacts->add($phpgw_info["user"]["account_id"],$entry); + for ($i=0;$i'.$i.': '.$name.' => '.$value; + //$contacts->add($phpgw_info["user"]["account_id"],$entry); + } } - + return "Successfully imported $i records into your addressbook."; } function import_start_record($buffer) { $top=array(); + ++$this->id; $this->currentrecord = $top; return $buffer; } function import_end_record($buffer,$private="private") { global $phpgw_info; - $namelist=array(); while ( list($name, $value) = each($this->currentrecord)) { - $namelist = $namelist + array($name => $value); - echo '
'.$name.' => '.$value; + $buffer[$this->id][$name] = $value; + //echo '
'.$name.' => '.$value; } - echo '
'; - $buffer = $buffer + $namelist; return $buffer; }