*
* -------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU General Public License as published by the *
* Free Software Foundation; either version 2 of the License, or (at your *
* option) any later version. *
\**************************************************************************/
/* $Id$ */
class uiXport
{
var $template;
var $public_functions = array(
'import' => True,
'export' => True
);
var $bo;
var $cat;
var $start;
var $limit;
var $query;
var $sort;
var $order;
var $filter;
var $cat_id;
function uiXport()
{
$this->template = $GLOBALS['phpgw']->template;
$this->cat = CreateObject('phpgwapi.categories');
$this->bo = CreateObject('addressbook.boXport',True);
$this->browser = CreateObject('phpgwapi.browser');
$this->start = $this->bo->start;
$this->limit = $this->bo->limit;
$this->query = $this->bo->query;
$this->sort = $this->bo->sort;
$this->order = $this->bo->order;
$this->filter = $this->bo->filter;
$this->cat_id = $this->bo->cat_id;
}
/* Return a select form element with the categories option dialog in it */
function cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
{
if ($java)
{
$jselect = ' onChange="this.form.submit();"';
}
/* Setup all and none first */
$cats_link = "\n" .''."\n";
return $cats_link;
}
function import()
{
if ($_POST['convert'])
{
$buffer = $this->bo->import($tsvfile,$_POST['conv_type'],$_POST['private'],$_POST['fcat_id']);
if ($_POST['download'] == '')
{
if($_POST['conv_type'] == 'Debug LDAP' || $_POST['conv_type'] == 'Debug SQL' )
{
// filename, default application/octet-stream, length of file, default nocache True
$GLOBALS['phpgw']->browser->content_header($_POST['tsvfilename'],'',strlen($buffer));
echo $buffer;
}
else
{
$GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar();
echo "