forked from extern/egroupware
Some export and prefs fixes
This commit is contained in:
parent
523e7c5977
commit
2ae98b0577
@ -225,9 +225,9 @@
|
||||
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);
|
||||
$buffer=array();
|
||||
|
@ -164,7 +164,7 @@
|
||||
|
||||
if ($convert)
|
||||
{
|
||||
$buffer = $this->bo->export($cat_id);
|
||||
$buffer = $this->bo->export($conv_type,$cat_id);
|
||||
|
||||
if ($conv_type == 'none')
|
||||
{
|
||||
|
@ -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);
|
||||
}
|
||||
?>
|
||||
|
Loading…
Reference in New Issue
Block a user