Fixes for import

This commit is contained in:
Miles Lott 2001-07-10 20:47:26 +00:00
parent 07f5bb292c
commit 9b94656ff3
2 changed files with 6 additions and 32 deletions

View File

@ -90,9 +90,9 @@
$this->cat_id = $data['cat_id'];
}
function import()
function import($tsvfile,$conv_type,$private)
{
global $tsvfile,$private;
global $phpgw;
include (PHPGW_APP_INC . '/import/' . $conv_type);
@ -222,32 +222,7 @@
fclose($fp);
$buffer = $contacts->import_end_file($buffer,$private,$cat_id);
if ($download == '')
{
if($conv_type == 'Debug LDAP' || $conv_type == 'Debug SQL' )
{
// filename, default application/octet-stream, length of file, default nocache True
$phpgw->browser->content_header($tsvfilename,'',strlen($buffer));
echo $buffer;
}
else
{
$phpgw->common->phpgw_header();
echo parse_navbar();
echo "<pre>$buffer</pre>";
echo '<a href="'.$phpgw->link('/index.php','menuaction=addressbook.uiaddressbook.get_list') . '">'.lang("OK").'</a>';
$phpgw->common->phpgw_footer();
}
}
else
{
$phpgw->common->phpgw_header();
echo parse_navbar();
echo "<pre>$buffer</pre>";
echo '<a href="'.$phpgw->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'). '">'.lang("OK").'</a>';
$phpgw->common->phpgw_footer();
}
return $buffer;
}
function export($cat_id='')

View File

@ -75,12 +75,11 @@
function import()
{
global $phpgw,$convert,$download,$tsvfilename;
global $phpgw,$convert,$download,$tsvfile,$private,$conv_type;
if ($convert)
{
$buffer = $this->bo->import();
print_r($buffer);
$buffer = $this->bo->import($tsvfile,$conv_type,$private);
if ($download == '')
{
@ -141,7 +140,7 @@
$this->template->set_var('navbar_bg',$phpgw_info['theme']['navbar_bg']);
$this->template->set_var('navbar_text',$phpgw_info['theme']['navbar_text']);
$this->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard'));
$this->template->set_var('action_url',$phpgw->link('/index.php','menuaction=addressbook.boXport.import'));
$this->template->set_var('action_url',$phpgw->link('/index.php','menuaction=addressbook.uiXport.import'));
$this->template->set_var('cat_link',$this->cat_option($this->cat_id,True,False));
$this->template->set_var('tsvfilename','');
$this->template->set_var('conv',$conv);