Import now working

This commit is contained in:
Miles Lott 2001-03-11 07:36:43 +00:00
parent 16f18088d3
commit 1e6bd1b847

View File

@ -122,16 +122,18 @@
function import_end_file($buffer) {
global $phpgw,$phpgw_info;
//$contacts = CreateObject("phpgwapi.contacts");
$contacts = CreateObject("phpgwapi.contacts");
echo '<br>';
for ($i=0;$i<count($buffer);$i++) {
while ( list($name,$value) = each($buffer[$i]) ) {
echo '<br>'.$i.': '.$name.' => '.$value;
//$contacts->add($phpgw_info["user"]["account_id"],$entry);
for ($i=1;$i<=count($buffer);$i++) {
while ( list($name,$value) = @each($buffer[$i]) ) {
//echo '<br>'.$i.': '.$name.' => '.$value;
$entry[$i][$name] = $value;
}
//echo '<br>';
$contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
}
return "Successfully imported $i records into your addressbook.";
$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 '<br>'.$name.' => '.$value;