Some export and prefs fixes

This commit is contained in:
Miles Lott 2001-07-11 11:20:35 +00:00
parent 523e7c5977
commit 2ae98b0577
3 changed files with 50 additions and 3 deletions

View File

@ -225,9 +225,9 @@
return $buffer; return $buffer;
} }
function export($cat_id='') function export($conv_type,$cat_id='')
{ {
global $phpgw_info,$conv_type; global $phpgw_info;
include (PHPGW_APP_INC . '/export/' . $conv_type); include (PHPGW_APP_INC . '/export/' . $conv_type);
$buffer=array(); $buffer=array();

View File

@ -164,7 +164,7 @@
if ($convert) if ($convert)
{ {
$buffer = $this->bo->export($cat_id); $buffer = $this->bo->export($conv_type,$cat_id);
if ($conv_type == 'none') if ($conv_type == 'none')
{ {

View File

@ -156,4 +156,51 @@
} }
} }
function read_custom_fields()
{
global $phpgw_info;
$i = 0; $j = 0;
$fields = array();
@reset($phpgw_info['user']['preferences']['addressbook']);
while (list($col,$descr) = @each($phpgw_info['user']['preferences']['addressbook']))
{
if ( substr($col,0,6) == 'extra_' )
{
$fields[$j]['name'] = ereg_replace('extra_','',$col);
$fields[$j]['name'] = ereg_replace(' ','_',$fields[$j]['name']);
$fields[$j]['id'] = $i;
if ($query && ($fields[$j]['name'] != $query))
{
unset($fields[$j]['name']);
unset($fields[$j]['id']);
}
else
{
/* echo "<br>".$j.": '".$fields[$j]['name']."'"; */
$j++;
}
}
$i++;
}
@reset($fields);
return $fields;
}
function save_custom_field($old='',$new='')
{
global $phpgw,$phpgw_info;
$phpgw->preferences->read_repository($phpgw_info['user']['account_id']);
if ($old)
{
$phpgw->preferences->delete("addressbook","extra_".$old);
}
if($new)
{
$phpgw->preferences->add("addressbook","extra_".$new);
}
$phpgw->preferences->save_repository(1);
}
?> ?>