GLOBALS - an exercise in practice what you preach

This commit is contained in:
Miles Lott 2001-12-04 01:17:10 +00:00
parent dfcb5595f4
commit eb0592bb14
4 changed files with 4 additions and 16 deletions

View File

@ -57,7 +57,6 @@
function import_end_record($buffer) function import_end_record($buffer)
{ {
global $phpgw_info;
$buffer[$this->id]=''; $buffer[$this->id]='';
while ( list($name, $value) = each($this->currentrecord)) while ( list($name, $value) = each($this->currentrecord))
{ {
@ -70,8 +69,6 @@
function import_end_file($buffer,$access='private',$cat_id=0) function import_end_file($buffer,$access='private',$cat_id=0)
{ {
global $phpgw,$phpgw_info;
for ($i=1;$i<=count($buffer);$i++) for ($i=1;$i<=count($buffer);$i++)
{ {
/* /*
@ -81,7 +78,7 @@
*/ */
$entry = $this->vcard->in($buffer[$i]); $entry = $this->vcard->in($buffer[$i]);
/* Now actually add the new entry */ /* Now actually add the new entry */
$this->contacts->add($phpgw_info['user']['account_id'],$entry,$access,$cat_id); $this->contacts->add($GLOBALS['phpgw_info']['user']['account_id'],$entry,$access,$cat_id);
} }
$num = $i - 1; $num = $i - 1;
return lang('Successfully imported x records into your addressbook.',$num); return lang('Successfully imported x records into your addressbook.',$num);

View File

@ -76,7 +76,6 @@
function import_end_record($buffer) function import_end_record($buffer)
{ {
global $phpgw_info;
$buffer[$this->id]=''; $buffer[$this->id]='';
while ( list($name, $value) = each($this->currentrecord)) while ( list($name, $value) = each($this->currentrecord))
{ {
@ -88,8 +87,6 @@
function import_end_file($buffer,$access='private',$cat_id=0) function import_end_file($buffer,$access='private',$cat_id=0)
{ {
global $phpgw,$phpgw_info;
$contacts = CreateObject('phpgwapi.contacts'); $contacts = CreateObject('phpgwapi.contacts');
/* echo '<br>'; */ /* echo '<br>'; */
for ($i=1;$i<=count($buffer);$i++) for ($i=1;$i<=count($buffer);$i++)
@ -104,7 +101,7 @@
$entry[$i]['adr_one_type'] = 'intl'; $entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl'; $entry[$i]['adr_two_type'] = 'intl';
/* echo '<br>'; */ /* echo '<br>'; */
$contacts->add($phpgw_info['user']['account_id'],$entry[$i],$access,$cat_id); $contacts->add($GLOBALS['phpgw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
} }
$num = $i - 1; $num = $i - 1;
return lang('Successfully imported x records into your addressbook.',$num); return lang('Successfully imported x records into your addressbook.',$num);

View File

@ -145,7 +145,6 @@
function import_end_record($buffer) function import_end_record($buffer)
{ {
global $phpgw_info;
$buffer[$this->id]=''; $buffer[$this->id]='';
while ( list($name, $value) = each($this->currentrecord)) while ( list($name, $value) = each($this->currentrecord))
{ {
@ -157,8 +156,6 @@
function import_end_file($buffer,$access='private',$cat_id=0) function import_end_file($buffer,$access='private',$cat_id=0)
{ {
global $phpgw,$phpgw_info;
$contacts = CreateObject('phpgwapi.contacts'); $contacts = CreateObject('phpgwapi.contacts');
//echo '<br>'; //echo '<br>';
for ($i=1;$i<=count($buffer);$i++) for ($i=1;$i<=count($buffer);$i++)
@ -173,7 +170,7 @@
$entry[$i]['adr_one_type'] = 'intl'; $entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl'; $entry[$i]['adr_two_type'] = 'intl';
//echo '<br>'; //echo '<br>';
$contacts->add($phpgw_info['user']['account_id'],$entry[$i],$access,$cat_id); $contacts->add($GLOBALS['phpgw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
} }
$num = $i - 1; $num = $i - 1;
return lang('Successfully imported x records into your addressbook.',$num); return lang('Successfully imported x records into your addressbook.',$num);

View File

@ -141,7 +141,6 @@
function import_end_record($buffer) function import_end_record($buffer)
{ {
global $phpgw_info;
$buffer[$this->id]=''; $buffer[$this->id]='';
while ( list($name, $value) = each($this->currentrecord)) while ( list($name, $value) = each($this->currentrecord))
{ {
@ -153,8 +152,6 @@
function import_end_file($buffer,$access='private',$cat_id=0) function import_end_file($buffer,$access='private',$cat_id=0)
{ {
global $phpgw,$phpgw_info;
$contacts = CreateObject('phpgwapi.contacts'); $contacts = CreateObject('phpgwapi.contacts');
//echo '<br>'; //echo '<br>';
for ($i=1;$i<=count($buffer);$i++) for ($i=1;$i<=count($buffer);$i++)
@ -169,7 +166,7 @@
$entry[$i]['adr_one_type'] = 'intl'; $entry[$i]['adr_one_type'] = 'intl';
$entry[$i]['adr_two_type'] = 'intl'; $entry[$i]['adr_two_type'] = 'intl';
//echo '<br>'; //echo '<br>';
$contacts->add($phpgw_info['user']['account_id'],$entry[$i],$access,$cat_id); $contacts->add($GLOBALS['phpgw_info']['user']['account_id'],$entry[$i],$access,$cat_id);
} }
$num = $i - 1; $num = $i - 1;
return lang('Successfully imported x records into your addressbook.',$num); return lang('Successfully imported x records into your addressbook.',$num);