Make buffer an array

This commit is contained in:
Miles Lott 2001-03-11 06:58:20 +00:00
parent 4171e4ada3
commit ed3da58048

View File

@ -13,12 +13,12 @@
/* $Id$ */
$phpgw_info["flags"]["currentapp"] = "addressbook";
$phpgw_info["flags"]["enable_addressbook_class"] = True;
$phpgw_info["flags"]["enable_contacts_class"] = True;
include("../header.inc.php");
$sep = $phpgw_info["server"]["dir_separator"];
# Construct a default basedn for Contacts if using LDAP
// Construct a default basedn for Contacts if using LDAP
$tmpbasedn = split(",",$phpgw_info["server"]["ldap_context"]);
array_shift($tmpbasedn);
for ($i=0;$i<count($tmpbasedn);$i++) {
@ -37,7 +37,7 @@
$dir_handle=opendir($phpgw_info["server"]["app_root"].$sep."conv");
$i=0; $myfilearray="";
while ($file = readdir($dir_handle)) {
#echo "<!-- ".is_file($phpgw_info["server"]["app_root"].$sep."conv".$sep.$file)." -->";
//echo "<!-- ".is_file($phpgw_info["server"]["app_root"].$sep."conv".$sep.$file)." -->";
if ((substr($file, 0, 1) != ".") && is_file($phpgw_info["server"]["app_root"].$sep."conv".$sep.$file) ) {
$myfilearray[$i] = $file;
$i++;
@ -62,19 +62,16 @@
$t->set_var("context",$context);
$t->set_var("download",lang("Submit"));
#$t->parse("out","import");
$t->pparse("out","import");
$phpgw->common->phpgw_footer();
} else {
include ($phpgw_info["server"]["app_root"].$sep."conv".$sep.$conv_type);
if ($private=="") { $private="public"; }
$row=0;
$buffer="";
$o = new outlook_conv;
$buffer = $o->outlook_start_file($buffer,$basedn,$context);
$buffer=array();
$o = new import_conv;
$buffer = $o->import_start_file($buffer,$basedn,$context);
$fp=fopen($tsvfile,"r");
while ($data = fgetcsv($fp,8000,",")) {
$num = count($data);
@ -82,19 +79,20 @@
if ($row == 1) {
$header = $data;
} else {
$buffer = $o->outlook_start_record($buffer);
$buffer = $o->import_start_record($buffer);
for ($c=0; $c<$num; $c++ ) {
//Send name/value pairs along with the buffer
if ($o->outlook[$header[$c]]!="" && $data[$c]!="") {
$buffer = $o->outlook_new_attrib($buffer, $o->outlook[$header[$c]],$data[$c]);
if ($o->import[$header[$c]]!="" && $data[$c]!="") {
$buffer = $o->import_new_attrib($buffer, $o->import[$header[$c]],$data[$c]);
}
}
$buffer = $o->outlook_end_record($buffer,$private);
$buffer = $o->import_end_record($buffer,$private);
}
}
fclose($fp);
$buffer = $o->outlook_end_file($buffer);
$buffer = $o->import_end_file($buffer);
if ($download == "") {
if($conv_type=="Debug LDAP" || $conv_type=="Debug SQL" ) {
header("Content-disposition: attachment; filename=\"conversion.txt\"");