[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: addressbook/inc class.uiaddressbook.inc.php,1.36
From: |
Miles Lott <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: addressbook/inc class.uiaddressbook.inc.php,1.36.2.4,1.36.2.5 class.uifields.inc.php,1.3,1.3.2.1 functions.inc.php,1.101,1.101.2.1 |
Date: |
Fri, 12 Apr 2002 23:22:45 -0400 |
Update of /cvsroot/phpgroupware/addressbook/inc
In directory subversions:/tmp/cvs-serv3008/addressbook/inc
Modified Files:
Tag: Version-0_9_14-branch
class.uiaddressbook.inc.php class.uifields.inc.php
functions.inc.php
Log Message:
Fix for addressbook custom fields
Index: class.uiaddressbook.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uiaddressbook.inc.php,v
retrieving revision 1.36.2.4
retrieving revision 1.36.2.5
diff -C2 -r1.36.2.4 -r1.36.2.5
*** class.uiaddressbook.inc.php 31 Mar 2002 19:51:07 -0000 1.36.2.4
--- class.uiaddressbook.inc.php 13 Apr 2002 03:22:43 -0000 1.36.2.5
***************
*** 56,59 ****
--- 56,60 ----
$GLOBALS['phpgw']->browser =
CreateObject('phpgwapi.browser');
$GLOBALS['phpgw']->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
+ $this->fields = CreateObject('addressbook.uifields');
$this->bo =
CreateObject('addressbook.boaddressbook',True);
***************
*** 137,172 ****
}
- function read_custom_fields()
- {
- $fields = array();
- @reset($this->prefs);
- while (list($col,$descr) = @each($this->prefs))
- {
- $tmp = '';
- if ( substr($col,0,6) == 'extra_' )
- {
- $tmp = ereg_replace('extra_','',$col);
- $tmp = ereg_replace(' ','_',$tmp);
- $fields[$tmp] = $tmp;
- }
- }
- @reset($fields);
- return $fields;
- }
-
- function save_custom_field($old='',$new='')
- {
-
$GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']);
- if ($old)
- {
-
$GLOBALS['phpgw']->preferences->delete('addressbook','extra_' . $old);
- }
- if($new)
- {
-
$GLOBALS['phpgw']->preferences->add('addressbook','extra_' . $new);
- }
- $GLOBALS['phpgw']->preferences->save_repository(1);
- }
-
/* Return a select form element with the categories option
dialog in it */
function
cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
--- 138,141 ----
***************
*** 256,262 ****
}
- /*
- Former index.php
- */
function index()
{
--- 225,228 ----
***************
*** 270,274 ****
$this->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer');
! $customfields = $this->read_custom_fields();
if (!isset($this->cat_id))
--- 236,246 ----
$this->template->set_block('addressbook_list_t','addressbook_footer','addressbook_footer');
! $custom = $this->fields->read_custom_fields();
! $customfields = array();
! while(list($x,$y) = @each($custom))
! {
! $customfields[$y['name']] = $y['name'];
! $namedfields[$y['name']] = $y['title'];
! }
if (!isset($this->cat_id))
***************
*** 286,293 ****
/* $qfields = $contacts->stock_contact_fields +
$extrafields + $customfields; */
/* create column list and the top row of the table
based on user prefs */
! while ($column =
each($this->contacts->stock_contact_fields))
{
$test = strtolower($column[0]);
! if (isset($this->prefs[$test]) &&
$this->prefs[$test])
{
$showcol =
$this->display_name($column[0]);
--- 258,265 ----
/* $qfields = $contacts->stock_contact_fields +
$extrafields + $customfields; */
/* create column list and the top row of the table
based on user prefs */
! while($column =
each($this->contacts->stock_contact_fields))
{
$test = strtolower($column[0]);
! if(isset($this->prefs[$test]) &&
$this->prefs[$test])
{
$showcol =
$this->display_name($column[0]);
***************
*** 305,309 ****
/* Setup the columns for non-standard fields, since we
don't allow sorting */
$nonstd = $this->extrafields + $customfields;
! while ($column = each($nonstd))
{
$test = strtolower($column[1]);
--- 277,281 ----
/* Setup the columns for non-standard fields, since we
don't allow sorting */
$nonstd = $this->extrafields + $customfields;
! while($column = @each($nonstd))
{
$test = strtolower($column[1]);
***************
*** 312,316 ****
$showcol =
$this->display_name($column[0]);
/* This must be a custom field */
! if (!$showcol) { $showcol = $column[1];
}
$cols .= ' <td height="21">' . "\n";
$cols .= ' <font size="-1"
face="Arial, Helvetica, sans-serif">';
--- 284,292 ----
$showcol =
$this->display_name($column[0]);
/* This must be a custom field */
! if(!$showcol)
! {
! // $showcol = $column[1];
! $showcol =
$namedfields[$column[1]];
! }
$cols .= ' <td height="21">' . "\n";
$cols .= ' <font size="-1"
face="Arial, Helvetica, sans-serif">';
***************
*** 323,328 ****
}
}
/* Check if prefs were set, if not, create some
defaults */
! if (!$columns_to_display )
{
$columns_to_display = array(
--- 299,305 ----
}
}
+
/* Check if prefs were set, if not, create some
defaults */
! if(!$columns_to_display)
{
$columns_to_display = array(
***************
*** 331,335 ****
'org_name' => 'org_name'
);
! $columns_to_display = $columns_to_display +
$customfields;
/* No prefs,. so cols above may have been set
to '' or a bunch of <td></td> */
$cols='';
--- 308,312 ----
'org_name' => 'org_name'
);
! // $columns_to_display = $columns_to_display +
$customfields;
/* No prefs,. so cols above may have been set
to '' or a bunch of <td></td> */
$cols='';
***************
*** 348,352 ****
}
! if (!$this->start)
{
$this->start = 0;
--- 325,329 ----
}
! if(!$this->start)
{
$this->start = 0;
***************
*** 364,368 ****
/*global $filter; */
! if (empty($this->filter) || !isset($this->filter))
{
if($this->prefs['default_filter'])
--- 341,345 ----
/*global $filter; */
! if(empty($this->filter) || !isset($this->filter))
{
if($this->prefs['default_filter'])
***************
*** 636,639 ****
--- 613,622 ----
echo parse_navbar();
+ $custom = $this->fields->read_custom_fields();
+ while(list($x,$y) = @each($custom))
+ {
+ $customfields[$y['name']] = $y['title'];
+ }
+
$this->addressbook_form('','menuaction=addressbook.uiaddressbook.add','Add','',$customfields,$this->cat_id);
***************
*** 689,693 ****
/* Read in user custom fields, if any */
! $customfields = $this->read_custom_fields();
/* merge in extra fields */
--- 672,680 ----
/* Read in user custom fields, if any */
! $custom = $this->fields->read_custom_fields();
! while(list($x,$y) = @each($custom))
! {
! $customfields[$y['name']] = $y['title'];
! }
/* merge in extra fields */
***************
*** 796,800 ****
$this->template->set_block('view_t','view_buttons','view_buttons');
! $customfields = $this->read_custom_fields();
/* _debug_array($this->prefs); */
while (list($column,$x) =
each($this->contacts->stock_contact_fields))
--- 783,792 ----
$this->template->set_block('view_t','view_buttons','view_buttons');
! $custom = $this->fields->read_custom_fields();
! while(list($x,$y) = @each($custom))
! {
! $customfields[$y['name']] = $y['title'];
! }
!
/* _debug_array($this->prefs); */
while (list($column,$x) =
each($this->contacts->stock_contact_fields))
***************
*** 1020,1025 ****
$fcat_id = $GLOBALS['HTTP_POST_VARS']['fcat_id'];
! /* _debug_array($this->prefs); */
! $customfields = $this->read_custom_fields();
$qfields = $this->contacts->stock_contact_fields +
$this->extrafields + $customfields;
--- 1012,1020 ----
$fcat_id = $GLOBALS['HTTP_POST_VARS']['fcat_id'];
! $custom = $this->fields->read_custom_fields();
! while(list($x,$y) = @each($custom))
! {
! $customfields[$y['name']] = $y['name'];
! }
$qfields = $this->contacts->stock_contact_fields +
$this->extrafields + $customfields;
***************
*** 1256,1263 ****
$fields['adr_two_type'] = substr($typeb,0,-1);
! $custom = $this->read_custom_fields();
! while (list($name,$val) = @each($custom))
{
! $fields[$name] = $entry[$val];
}
--- 1251,1258 ----
$fields['adr_two_type'] = substr($typeb,0,-1);
! $custom = $this->fields->read_custom_fields();
! while(list($name,$val) = @each($custom))
{
! $fields[$val['name']] = $entry[$val['name']];
}
Index: class.uifields.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/class.uifields.inc.php,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -r1.3 -r1.3.2.1
*** class.uifields.inc.php 1 Jan 2002 19:03:26 -0000 1.3
--- class.uifields.inc.php 13 Apr 2002 03:22:43 -0000 1.3.2.1
***************
*** 3,7 ****
* phpGroupWare - Addressbook *
* http://www.phpgroupware.org *
! * Written by Bettina Gille address@hidden *
* ----------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
--- 3,8 ----
* phpGroupWare - Addressbook *
* http://www.phpgroupware.org *
! * Written by Joseph Engo <address@hidden> and *
! * Miles Lott <miloschphpgroupware.org> *
* ----------------------------------------------- *
* This program is free software; you can redistribute it and/or modify it *
***************
*** 10,13 ****
--- 11,15 ----
* option) any later version. *
\**************************************************************************/
+
/* $Id$ */
***************
*** 25,28 ****
--- 27,31 ----
$GLOBALS['phpgw']->template =
CreateObject('phpgwapi.Template',PHPGW_APP_TPL);
$GLOBALS['phpgw']->nextmatchs =
CreateObject('phpgwapi.nextmatchs');
+ $this->config =
CreateObject('phpgwapi.config','addressbook');
}
***************
*** 34,38 ****
echo parse_navbar();
echo lang('access not permitted');
- $GLOBALS['phpgw']->common->phpgw_footer();
$GLOBALS['phpgw']->common->phpgw_exit();
}
--- 37,40 ----
***************
*** 45,53 ****
$field = $GLOBALS['HTTP_POST_VARS']['field'];
! $start = $GLOBALS['HTTP_POST_VARS']['start'];
! $query = $GLOBALS['HTTP_POST_VARS']['query'];
! $sort = $GLOBALS['HTTP_POST_VARS']['sort'];
! $order = $GLOBALS['HTTP_POST_VARS']['order'];
! $filter = $GLOBALS['HTTP_POST_VARS']['filter'];
$common_hidden_vars =
--- 47,53 ----
$field = $GLOBALS['HTTP_POST_VARS']['field'];
! $start = $GLOBALS['HTTP_POST_VARS']['start'] ?
$GLOBALS['HTTP_POST_VARS']['start'] : $GLOBALS['HTTP_GET_VARS']['start'];
! $query = $GLOBALS['HTTP_POST_VARS']['query'] ?
$GLOBALS['HTTP_POST_VARS']['query'] : $GLOBALS['HTTP_GET_VARS']['query'];
! $sort = $GLOBALS['HTTP_POST_VARS']['sort'] ?
$GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort'];
$common_hidden_vars =
***************
*** 67,81 ****
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
! if (!$start)
{
$start = 0;
}
! if (!$sort)
{
$sort = 'ASC';
}
! $fields =
$this->read_custom_fields($start,$limit,$query,$sort,$order);
$total_records = count($fields);
--- 67,81 ----
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/admin/index.php'));
! if(!$start)
{
$start = 0;
}
! if(!$sort)
{
$sort = 'ASC';
}
! $fields =
$this->read_custom_fields($start,$limit,$query,$sort);
$total_records = count($fields);
***************
*** 93,97 ****
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
! for ($i=0;$i<count($fields);$i++)
{
$tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
--- 93,97 ----
$GLOBALS['phpgw']->template->set_var('lang_delete',lang('Delete'));
! for($i=0;$i<count($fields);$i++)
{
$tr_color =
$GLOBALS['phpgw']->nextmatchs->alternate_row_color($tr_color);
***************
*** 99,104 ****
$field = $fields[$i]['name'];
!
$GLOBALS['phpgw']->template->set_var('cfield',$field);
$GLOBALS['phpgw']->template->set_var('edit',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.edit&field=$field&start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
--- 99,105 ----
$field = $fields[$i]['name'];
+ $title = $fields[$i]['title'];
!
$GLOBALS['phpgw']->template->set_var('cfield',$title);
$GLOBALS['phpgw']->template->set_var('edit',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.edit&field=$field&start=$start&query=$query&sort=$sort&order=$order&filter=$filter"));
***************
*** 112,117 ****
$GLOBALS['phpgw']->template->parse('out','field_list_t',True);
$GLOBALS['phpgw']->template->p('out');
-
- $GLOBALS['phpgw']->common->phpgw_footer();
}
--- 113,116 ----
***************
*** 123,127 ****
echo parse_navbar();
echo lang('access not permitted');
- $GLOBALS['phpgw']->common->phpgw_footer();
$GLOBALS['phpgw']->common->phpgw_exit();
}
--- 122,125 ----
***************
*** 132,135 ****
--- 130,134 ----
$query = $GLOBALS['HTTP_POST_VARS']['query'];
$sort = $GLOBALS['HTTP_POST_VARS']['sort'];
+ $submit = $GLOBALS['HTTP_POST_VARS']['submit'];
$GLOBALS['phpgw']->template->set_file(array('form' =>
'field_form.tpl'));
***************
*** 137,145 ****
$GLOBALS['phpgw']->template->set_block('form','edit','edithandle');
! if ($GLOBALS['HTTP_POST_VARS']['submit'])
{
$errorcount = 0;
! if (!$field_name)
{
$error[$errorcount++] = lang('Please
enter a name for that field !');
--- 136,144 ----
$GLOBALS['phpgw']->template->set_block('form','edit','edithandle');
! if($submit)
{
$errorcount = 0;
! if(!$field_name)
{
$error[$errorcount++] = lang('Please
enter a name for that field !');
***************
*** 147,156 ****
$fields =
$this->read_custom_fields($start,$limit,$field_name);
! if ($fields[0]['name'])
{
$error[$errorcount++] = lang('That
field name has been used already !');
}
! if (! $error)
{
$field_name = addslashes($field_name);
--- 146,155 ----
$fields =
$this->read_custom_fields($start,$limit,$field_name);
! if($fields[0]['name'])
{
$error[$errorcount++] = lang('That
field name has been used already !');
}
! if(!$error)
{
$field_name = addslashes($field_name);
***************
*** 162,174 ****
echo parse_navbar();
! if ($errorcount)
{
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
}
! if (($submit) && (! $error) && (! $errorcount))
{
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been added !',
$field_name));
}
! if ((! $submit) && (! $error) && (! $errorcount))
{
$GLOBALS['phpgw']->template->set_var('message','');
--- 161,173 ----
echo parse_navbar();
! if($errorcount)
{
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
}
! if(($submit) && (! $error) && (! $errorcount))
{
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been added !',
$field_name));
}
! if((!$submit) && (! $error) && (! $errorcount))
{
$GLOBALS['phpgw']->template->set_var('message','');
***************
*** 201,207 ****
echo parse_navbar();
echo lang('access not permitted');
- $GLOBALS['phpgw']->common->phpgw_footer();
$GLOBALS['phpgw']->common->phpgw_exit();
-
}
--- 200,204 ----
***************
*** 227,238 ****
. '<input type="hidden" name="field" value="' .
$field . '">' . "\n";
! if ($submit)
{
$errorcount = 0;
! if (!$field_name) { $error[$errorcount++] =
lang('Please enter a name for that field!'); }
$field_name = addslashes($field_name);
! if (! $error)
{
$this->save_custom_field($field,$field_name);
--- 224,238 ----
. '<input type="hidden" name="field" value="' .
$field . '">' . "\n";
! if($submit)
{
$errorcount = 0;
! if(!$field_name)
! {
! $error[$errorcount++] = lang('Please
enter a name for that field!');
! }
$field_name = addslashes($field_name);
! if(!$error)
{
$this->save_custom_field($field,$field_name);
***************
*** 243,260 ****
echo parse_navbar();
! if ($errorcount)
{
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
}
! if (($submit) && (! $error) && (! $errorcount))
{
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been updated
!', $field_name));
}
! if ((! $submit) && (! $error) && (! $errorcount))
{
$GLOBALS['phpgw']->template->set_var('message','');
}
! if ($submit)
{
$field = $field_name;
--- 243,260 ----
echo parse_navbar();
! if($errorcount)
{
$GLOBALS['phpgw']->template->set_var('message',$GLOBALS['phpgw']->common->error_list($error));
}
! if(($submit) && (! $error) && (!$errorcount))
{
$GLOBALS['phpgw']->template->set_var('message',lang('Field x has been updated
!', $field_name));
}
! if((!$submit) && (!$error) && (!$errorcount))
{
$GLOBALS['phpgw']->template->set_var('message','');
}
! if($submit)
{
$field = $field_name;
***************
*** 263,272 ****
{
$fields =
$this->read_custom_fields($start,$limit,$field);
! $field =
$GLOBALS['phpgw']->strip_html($fields[0]['name']);
}
$GLOBALS['phpgw']->template->set_var('title_fields',lang('Edit Custom Field'));
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.edit'));
!
$GLOBALS['phpgw']->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.delete&field=$field&start=$start&query=$query&sort=$sort"));
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&start=$start&query=$query&sort=$sort"));
--- 263,273 ----
{
$fields =
$this->read_custom_fields($start,$limit,$field);
! $field =
$GLOBALS['phpgw']->strip_html($fields[0]['title']);
! $fn = $fields[0]['name'];
}
$GLOBALS['phpgw']->template->set_var('title_fields',lang('Edit Custom Field'));
$GLOBALS['phpgw']->template->set_var('actionurl',$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.edit'));
!
$GLOBALS['phpgw']->template->set_var('deleteurl',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.delete&field=$fn&start=$start&query=$query&sort=$sort"));
$GLOBALS['phpgw']->template->set_var('doneurl',$GLOBALS['phpgw']->link('/index.php',"menuaction=addressbook.uifields.index&start=$start&query=$query&sort=$sort"));
***************
*** 289,292 ****
--- 290,301 ----
function delete()
{
+ if(!$GLOBALS['phpgw']->acl->check('run',1,'admin'))
+ {
+ $GLOBALS['phpgw']->common->phpgw_header();
+ echo parse_navbar();
+ echo lang('access not permitted');
+ $GLOBALS['phpgw']->common->phpgw_exit();
+ }
+
$field = $GLOBALS['HTTP_POST_VARS']['field'] ?
$GLOBALS['HTTP_POST_VARS']['field'] : $GLOBALS['HTTP_GET_VARS']['field'];
$field_id = $GLOBALS['HTTP_POST_VARS']['field_id'] ?
$GLOBALS['HTTP_POST_VARS']['field_id'] : $GLOBALS['HTTP_GET_VARS']['field_id'];
***************
*** 295,304 ****
$sort = $GLOBALS['HTTP_POST_VARS']['sort'] ?
$GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort'];
! if (!$field)
{
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
}
! if ($GLOBALS['HTTP_POST_VARS']['confirm'])
{
$this->save_custom_field($field);
--- 304,313 ----
$sort = $GLOBALS['HTTP_POST_VARS']['sort'] ?
$GLOBALS['HTTP_POST_VARS']['sort'] : $GLOBALS['HTTP_GET_VARS']['sort'];
! if(!$field)
{
Header('Location: ' .
$GLOBALS['phpgw']->link('/index.php','menuaction=addressbook.uifields.index'));
}
! if($GLOBALS['HTTP_POST_VARS']['confirm'])
{
$this->save_custom_field($field);
***************
*** 339,369 ****
}
! function read_custom_fields()
{
! $i = 0; $j = 0;
$fields = array();
!
@reset($GLOBALS['phpgw_info']['user']['preferences']['addressbook']);
! while (list($col,$descr) =
@each($GLOBALS['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;
}
--- 348,398 ----
}
! function read_custom_fields($start=0,$limit=5,$query='')
{
! $i = 0;
$fields = array();
!
! $this->config->read_repository();
!
! while(list($name,$descr) =
@each($this->config->config_data['custom_fields']))
{
! /*
! if($start < $i)
{
! continue;
! }
! */
! $test = @strtolower($name);
! //if($query &&
!strstr($test,strtolower($query)))
! if($query && ($query != $test))
! {
! }
! else
! {
! $fields[$i]['name'] = $name;
! $fields[$i]['title'] = $descr;
! $fields[$i]['id'] = $i;
!
! /*
! if($i >= $limit)
{
! break;
}
+ */
+ $i++;
}
! }
! switch($sort)
! {
! case 'DESC';
! krsort($fields);
! break;
! case 'ASC':
! default:
! ksort($fields);
}
@reset($fields);
+
return $fields;
}
***************
*** 371,384 ****
function save_custom_field($old='',$new='')
{
!
$GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']);
! if ($old)
{
!
$GLOBALS['phpgw']->preferences->delete("addressbook","extra_".$old);
}
if($new)
{
!
$GLOBALS['phpgw']->preferences->add("addressbook","extra_".$new);
}
! $GLOBALS['phpgw']->preferences->save_repository(1);
}
}
--- 400,421 ----
function save_custom_field($old='',$new='')
{
! $this->config->read_repository();
!
!
if(!is_array($this->config->config_data['custom_fields']))
{
! $this->config->config_data['custom_fields'] =
array();
! }
!
! if($old)
! {
!
unset($this->config->config_data['custom_fields'][$old]);
}
if($new)
{
! $tmp = strtolower(ereg_replace(' ','_',$new));
!
$this->config->config_data['custom_fields'][$tmp] = $new;
}
!
! $this->config->save_repository();
}
}
Index: functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/addressbook/inc/functions.inc.php,v
retrieving revision 1.101
retrieving revision 1.101.2.1
diff -C2 -r1.101 -r1.101.2.1
*** functions.inc.php 4 Aug 2001 14:12:32 -0000 1.101
--- functions.inc.php 13 Apr 2002 03:22:43 -0000 1.101.2.1
***************
*** 44,49 ****
function cat_option($cat_id='',$notall=False,$java=True,$multiple=False)
{
- global $phpgw;
-
if ($java)
{
--- 44,47 ----
***************
*** 63,67 ****
/* Get global and app-specific category listings */
! $cats_link .=
$phpgw->categories->formated_list('select','all',$cat_id,True);
$cats_link .= '</select>'."\n";
return $cats_link;
--- 61,65 ----
/* Get global and app-specific category listings */
! $cats_link .=
$GLOBALS['phpgw']->categories->formated_list('select','all',$cat_id,True);
$cats_link .= '</select>'."\n";
return $cats_link;
***************
*** 135,144 ****
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_' )
--- 133,140 ----
function read_custom_fields()
{
$i = 0; $j = 0;
$fields = array();
!
@reset($GLOBALS['phpgw_info']['user']['preferences']['addressbook']);
! while (list($col,$descr) =
@each($GLOBALS['phpgw_info']['user']['preferences']['addressbook']))
{
if ( substr($col,0,6) == 'extra_' )
***************
*** 167,182 ****
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);
}
?>
--- 163,176 ----
function save_custom_field($old='',$new='')
{
!
$GLOBALS['phpgw']->preferences->read_repository($GLOBALS['phpgw_info']['user']['account_id']);
if ($old)
{
!
$GLOBALS['phpgw']->preferences->delete("addressbook","extra_".$old);
}
if($new)
{
!
$GLOBALS['phpgw']->preferences->add("addressbook","extra_".$new);
}
! $GLOBALS['phpgw']->preferences->save_repository(1);
}
?>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: addressbook/inc class.uiaddressbook.inc.php,1.36.2.4,1.36.2.5 class.uifields.inc.php,1.3,1.3.2.1 functions.inc.php,1.101,1.101.2.1,
Miles Lott <address@hidden> <=