Fix call to get_list (now index), some globals work

This commit is contained in:
Miles Lott 2001-12-30 11:57:02 +00:00
parent e46451e26a
commit 820b5adbe5

View File

@ -32,9 +32,7 @@
function uiXport() function uiXport()
{ {
global $phpgw; $this->template = $GLOBALS['phpgw']->template;
$this->template = $phpgw->template;
$this->cat = CreateObject('phpgwapi.categories'); $this->cat = CreateObject('phpgwapi.categories');
$this->bo = CreateObject('addressbook.boXport',True); $this->bo = CreateObject('addressbook.boXport',True);
$this->browser = CreateObject('phpgwapi.browser'); $this->browser = CreateObject('phpgwapi.browser');
@ -60,11 +58,11 @@
if (!$notall) if (!$notall)
{ {
$cats_link .= '<option value=""'; $cats_link .= '<option value=""';
if ($cat_id=="all") if ($cat_id=='all')
{ {
$cats_link .= ' selected'; $cats_link .= ' selected';
} }
$cats_link .= '>'.lang("all").'</option>'."\n"; $cats_link .= '>'.lang('all').'</option>'."\n";
} }
/* Get global and app-specific category listings */ /* Get global and app-specific category listings */
@ -75,7 +73,7 @@
function import() function import()
{ {
global $phpgw,$convert,$download,$tsvfile,$private,$conv_type,$fcat_id; global $convert,$download,$tsvfile,$private,$conv_type,$fcat_id;
if ($convert) if ($convert)
{ {
@ -86,31 +84,31 @@
if($conv_type == 'Debug LDAP' || $conv_type == 'Debug SQL' ) if($conv_type == 'Debug LDAP' || $conv_type == 'Debug SQL' )
{ {
// filename, default application/octet-stream, length of file, default nocache True // filename, default application/octet-stream, length of file, default nocache True
$phpgw->browser->content_header($tsvfilename,'',strlen($buffer)); $GLOBALS['phpgw']->browser->content_header($tsvfilename,'',strlen($buffer));
echo $buffer; echo $buffer;
} }
else else
{ {
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
echo "<pre>$buffer</pre>"; echo "<pre>$buffer</pre>";
echo '<a href="'.$phpgw->link('/index.php','menuaction=addressbook.uiaddressbook.get_list') . '">'.lang("OK").'</a>'; echo '<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index') . '">'.lang('OK').'</a>';
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
} }
} }
else else
{ {
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
echo "<pre>$buffer</pre>"; echo "<pre>$buffer</pre>";
echo '<a href="'.$phpgw->link('/index.php','menuaction=addressbook.uiaddressbook.get_list'). '">'.lang("OK").'</a>'; echo '<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'). '">'.lang('OK').'</a>';
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
} }
} }
else else
{ {
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
$this->template->set_file(array('import' => 'import.tpl')); $this->template->set_file(array('import' => 'import.tpl'));
@ -119,7 +117,6 @@
$i=0; $myfilearray = ''; $i=0; $myfilearray = '';
while ($file = readdir($dir_handle)) while ($file = readdir($dir_handle))
{ {
//echo "<!-- ".is_file($phpgw_info["server"]["app_root"].$sep."import".$sep.$file)." -->";
if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) ) if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'import' . SEP . $file) )
{ {
$myfilearray[$i] = $file; $myfilearray[$i] = $file;
@ -136,11 +133,11 @@
$this->template->set_var('lang_cancel',lang('Cancel')); $this->template->set_var('lang_cancel',lang('Cancel'));
$this->template->set_var('lang_cat',lang('Select Category')); $this->template->set_var('lang_cat',lang('Select Category'));
$this->template->set_var('cancel_url',$phpgw->link('/index.php','menuaction=addressbook.uiaddressbook.get_list')); $this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiaddressbook.index'));
$this->template->set_var('navbar_bg',$phpgw_info['theme']['navbar_bg']); $this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
$this->template->set_var('navbar_text',$phpgw_info['theme']['navbar_text']); $this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
$this->template->set_var('import_text',lang('Import from LDIF, CSV, or VCard')); $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.uiXport.import')); $this->template->set_var('action_url',$GLOBALS['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('cat_link',$this->cat_option($this->cat_id,True,False));
$this->template->set_var('tsvfilename',''); $this->template->set_var('tsvfilename','');
$this->template->set_var('conv',$conv); $this->template->set_var('conv',$conv);
@ -155,12 +152,12 @@
$this->template->set_var('cat_id',$this->cat_id); $this->template->set_var('cat_id',$this->cat_id);
$this->template->pparse('out','import'); $this->template->pparse('out','import');
} }
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
} }
function export() function export()
{ {
global $phpgw,$phpgw_info,$convert,$tsvfilename,$cat_id,$download,$conv_type; global $convert,$tsvfilename,$cat_id,$download,$conv_type;
if ($convert) if ($convert)
{ {
@ -168,14 +165,14 @@
if ($conv_type == 'none') if ($conv_type == 'none')
{ {
$phpgw_info['flags']['noheader'] = False; $GLOBALS['phpgw_info']['flags']['noheader'] = False;
$phpgw_info['flags']['noheader'] = True; $GLOBALS['phpgw_info']['flags']['noheader'] = True;
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
echo lang('<b>No conversion type &lt;none&gt; could be located.</b> Please choose a conversion type from the list'); echo lang('<b>No conversion type &lt;none&gt; could be located.</b> Please choose a conversion type from the list');
echo '&nbsp<a href="'.$phpgw->link('/index.php','menuaction=addressbook.uiXport.export') . '">' . lang('OK') . '</a>'; echo '&nbsp<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export') . '">' . lang('OK') . '</a>';
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
$phpgw->common->phpgw_exit(); $GLOBALS['phpgw']->common->phpgw_exit();
} }
if ( ($download == 'on') || ($o->type == 'pdb') ) if ( ($download == 'on') || ($o->type == 'pdb') )
@ -186,18 +183,18 @@
} }
else else
{ {
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
echo "<pre>\n"; echo "<pre>\n";
echo $buffer; echo $buffer;
echo "\n</pre>\n"; echo "\n</pre>\n";
echo '<a href="'.$phpgw->link('/index.php','menuaction=addressbook.uiXport.export') . '">' . lang('OK') . '</a>'; echo '<a href="'.$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export') . '">' . lang('OK') . '</a>';
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
} }
} }
else else
{ {
$phpgw->common->phpgw_header(); $GLOBALS['phpgw']->common->phpgw_header();
echo parse_navbar(); echo parse_navbar();
$this->template->set_file(array('export' => 'export.tpl')); $this->template->set_file(array('export' => 'export.tpl'));
@ -206,7 +203,6 @@
$i=0; $myfilearray = ''; $i=0; $myfilearray = '';
while ($file = readdir($dir_handle)) while ($file = readdir($dir_handle))
{ {
#echo "<!-- ".is_file($phpgw_info["server"]["app_root"].$sep."conv".$sep.$file)." -->";
if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) ) if ((substr($file, 0, 1) != '.') && is_file(PHPGW_APP_INC . SEP . 'export' . SEP . $file) )
{ {
$myfilearray[$i] = $file; $myfilearray[$i] = $file;
@ -224,11 +220,11 @@
$this->template->set_var('lang_cancel',lang('Cancel')); $this->template->set_var('lang_cancel',lang('Cancel'));
$this->template->set_var('lang_cat',lang('Select Category')); $this->template->set_var('lang_cat',lang('Select Category'));
$this->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False)); $this->template->set_var('cat_link',$this->cat_option($this->cat_id,False,False));
$this->template->set_var('cancel_url',$phpgw->link('/addressbook/index.php')); $this->template->set_var('cancel_url',$GLOBALS['phpgw']->link('/addressbook/index.php'));
$this->template->set_var('navbar_bg',$phpgw_info['theme']['navbar_bg']); $this->template->set_var('navbar_bg',$GLOBALS['phpgw_info']['theme']['navbar_bg']);
$this->template->set_var('navbar_text',$phpgw_info['theme']['navbar_text']); $this->template->set_var('navbar_text',$GLOBALS['phpgw_info']['theme']['navbar_text']);
$this->template->set_var('export_text',lang('Export from Addressbook')); $this->template->set_var('export_text',lang('Export from Addressbook'));
$this->template->set_var('action_url',$phpgw->link('/index.php','menuaction=addressbook.uiXport.export')); $this->template->set_var('action_url',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uiXport.export'));
$this->template->set_var('filename',lang('Export file name')); $this->template->set_var('filename',lang('Export file name'));
$this->template->set_var('conv',$conv); $this->template->set_var('conv',$conv);
$this->template->set_var('debug',lang('')); $this->template->set_var('debug',lang(''));
@ -241,7 +237,7 @@
$this->template->set_var('cat_id',$this->cat_id); $this->template->set_var('cat_id',$this->cat_id);
$this->template->pparse('out','export'); $this->template->pparse('out','export');
$phpgw->common->phpgw_footer(); $GLOBALS['phpgw']->common->phpgw_footer();
} }
} }
} }