mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-25 14:41:50 +01:00
Reorganize functions to represent order of operation
This commit is contained in:
parent
b86bdac902
commit
0b793c0a07
@ -53,6 +53,33 @@
|
|||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function import_start_record($buffer) {
|
||||||
|
$top=array();
|
||||||
|
++$this->id;
|
||||||
|
$this->currentrecord = $top;
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
function import_new_attrib($buffer,$name,$value) {
|
||||||
|
// chop leading space from value
|
||||||
|
$value = trim($value);
|
||||||
|
$value = str_replace("\r","",$value);
|
||||||
|
//echo '<br>'.$name.' => '.$value;
|
||||||
|
$this->currentrecord += array($name => $value);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
function import_end_record($buffer,$private="private") {
|
||||||
|
global $phpgw_info;
|
||||||
|
$buffer[$this->id]="";
|
||||||
|
while ( list($name, $value) = each($this->currentrecord)) {
|
||||||
|
$buffer[$this->id][$name] = $value;
|
||||||
|
//echo '<br>'.$this->id.': '.$name.' => '.$value;
|
||||||
|
}
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
function import_end_file($buffer) {
|
function import_end_file($buffer) {
|
||||||
global $phpgw,$phpgw_info;
|
global $phpgw,$phpgw_info;
|
||||||
|
|
||||||
@ -73,32 +100,5 @@
|
|||||||
$num = $i - 1;
|
$num = $i - 1;
|
||||||
return "Successfully imported $num records into your addressbook.";
|
return "Successfully imported $num records into your addressbook.";
|
||||||
}
|
}
|
||||||
|
|
||||||
function import_start_record($buffer) {
|
|
||||||
$top=array();
|
|
||||||
++$this->id;
|
|
||||||
$this->currentrecord = $top;
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
function import_end_record($buffer,$private="private") {
|
|
||||||
global $phpgw_info;
|
|
||||||
$buffer[$this->id]="";
|
|
||||||
while ( list($name, $value) = each($this->currentrecord)) {
|
|
||||||
$buffer[$this->id][$name] = $value;
|
|
||||||
//echo '<br>'.$this->id.': '.$name.' => '.$value;
|
|
||||||
}
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
function import_new_attrib($buffer,$name,$value) {
|
|
||||||
// chop leading space from value
|
|
||||||
$value = trim($value);
|
|
||||||
$value = str_replace("\r","",$value);
|
|
||||||
//echo '<br>'.$name.' => '.$value;
|
|
||||||
$this->currentrecord += array($name => $value);
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -120,6 +120,32 @@
|
|||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function import_start_record($buffer) {
|
||||||
|
$top=array();
|
||||||
|
++$this->id;
|
||||||
|
$this->currentrecord = $top;
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
function import_new_attrib($buffer,$name,$value) {
|
||||||
|
$value = trim($value);
|
||||||
|
$value = str_replace("\n","<BR>",$value);
|
||||||
|
$value = str_replace("\r","",$value);
|
||||||
|
$this->currentrecord += array($name => $value);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
function import_end_record($buffer,$private="private") {
|
||||||
|
global $phpgw_info;
|
||||||
|
$buffer[$this->id]="";
|
||||||
|
while ( list($name, $value) = each($this->currentrecord)) {
|
||||||
|
$buffer[$this->id][$name] = $value;
|
||||||
|
//echo '<br>'.$name.' => '.$value;
|
||||||
|
}
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
function import_end_file($buffer) {
|
function import_end_file($buffer) {
|
||||||
global $phpgw,$phpgw_info;
|
global $phpgw,$phpgw_info;
|
||||||
|
|
||||||
@ -140,31 +166,5 @@
|
|||||||
$num = $i - 1;
|
$num = $i - 1;
|
||||||
return "Successfully imported $num records into your addressbook.";
|
return "Successfully imported $num records into your addressbook.";
|
||||||
}
|
}
|
||||||
|
|
||||||
function import_start_record($buffer) {
|
|
||||||
$top=array();
|
|
||||||
++$this->id;
|
|
||||||
$this->currentrecord = $top;
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
function import_end_record($buffer,$private="private") {
|
|
||||||
global $phpgw_info;
|
|
||||||
$buffer[$this->id]="";
|
|
||||||
while ( list($name, $value) = each($this->currentrecord)) {
|
|
||||||
$buffer[$this->id][$name] = $value;
|
|
||||||
//echo '<br>'.$name.' => '.$value;
|
|
||||||
}
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
|
|
||||||
function import_new_attrib($buffer,$name,$value) {
|
|
||||||
$value = trim($value);
|
|
||||||
$value = str_replace("\n","<BR>",$value);
|
|
||||||
$value = str_replace("\r","",$value);
|
|
||||||
$this->currentrecord += array($name => $value);
|
|
||||||
|
|
||||||
return $buffer;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -31,11 +31,7 @@
|
|||||||
|
|
||||||
var $import = array(
|
var $import = array(
|
||||||
"fn" => "fn",
|
"fn" => "fn",
|
||||||
"n_given" => "n_given",
|
"n" => "n",
|
||||||
"n_family" => "n_family",
|
|
||||||
"n_middle" => "n_middle",
|
|
||||||
"n_prefix" => "n_prefix",
|
|
||||||
"n_suffix" => "n_suffix",
|
|
||||||
"sound" => "sound",
|
"sound" => "sound",
|
||||||
"bday" => "bday",
|
"bday" => "bday",
|
||||||
"note" => "note",
|
"note" => "note",
|
||||||
@ -43,8 +39,7 @@
|
|||||||
"geo" => "geo",
|
"geo" => "geo",
|
||||||
"url" => "url",
|
"url" => "url",
|
||||||
"pubkey" => "pubkey",
|
"pubkey" => "pubkey",
|
||||||
"org_name" => "org_name",
|
"org" => "org",
|
||||||
"org_unit" => "org_unit",
|
|
||||||
"title" => "title",
|
"title" => "title",
|
||||||
"adr" => "adr",
|
"adr" => "adr",
|
||||||
"label" => "label",
|
"label" => "label",
|
||||||
@ -58,27 +53,6 @@
|
|||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
function import_end_file($buffer) {
|
|
||||||
global $phpgw,$phpgw_info;
|
|
||||||
|
|
||||||
$contacts = CreateObject("phpgwapi.contacts");
|
|
||||||
echo '<br>';
|
|
||||||
for ($i=1;$i<=count($buffer);$i++) {
|
|
||||||
while ( list($name,$value) = @each($buffer[$i]) ) {
|
|
||||||
echo '<br>'.$i.': '.$name.' => '.$value;
|
|
||||||
$entry[$i][$name] = $value;
|
|
||||||
}
|
|
||||||
$entry[$i]['email_type'] = 'INTERNET';
|
|
||||||
$entry[$i]['email_home_type'] = 'INTERNET';
|
|
||||||
$entry[$i]['adr_one_type'] = 'intl';
|
|
||||||
$entry[$i]['adr_two_type'] = 'intl';
|
|
||||||
echo '<br>';
|
|
||||||
//$contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
|
|
||||||
}
|
|
||||||
$num = $i - 1;
|
|
||||||
return "Successfully imported $num records into your addressbook.";
|
|
||||||
}
|
|
||||||
|
|
||||||
function import_start_record($buffer) {
|
function import_start_record($buffer) {
|
||||||
$top=array();
|
$top=array();
|
||||||
++$this->id;
|
++$this->id;
|
||||||
@ -86,6 +60,15 @@
|
|||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function import_new_attrib($buffer,$name,$value) {
|
||||||
|
$value = trim($value);
|
||||||
|
$value = str_replace("\n","<BR>",$value);
|
||||||
|
$value = str_replace("\r","",$value);
|
||||||
|
$this->currentrecord += array($name => $value);
|
||||||
|
|
||||||
|
return $buffer;
|
||||||
|
}
|
||||||
|
|
||||||
function import_end_record($buffer,$private="private") {
|
function import_end_record($buffer,$private="private") {
|
||||||
global $phpgw_info;
|
global $phpgw_info;
|
||||||
$buffer[$this->id]="";
|
$buffer[$this->id]="";
|
||||||
@ -96,13 +79,25 @@
|
|||||||
return $buffer;
|
return $buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
function import_new_attrib($buffer,$name,$value) {
|
function import_end_file($buffer) {
|
||||||
$value = trim($value);
|
global $phpgw,$phpgw_info;
|
||||||
$value = str_replace("\n","<BR>",$value);
|
|
||||||
$value = str_replace("\r","",$value);
|
|
||||||
$this->currentrecord += array($name => $value);
|
|
||||||
|
|
||||||
return $buffer;
|
$contacts = CreateObject("phpgwapi.contacts");
|
||||||
|
//echo '<br>';
|
||||||
|
for ($i=1;$i<=count($buffer);$i++) {
|
||||||
|
while ( list($name,$value) = @each($buffer[$i]) ) {
|
||||||
|
echo '<br>'.$i.': '.$name.' => '.$value;
|
||||||
|
$entry[$i][$name] = $value;
|
||||||
|
}
|
||||||
|
$entry[$i]['email_type'] = 'INTERNET';
|
||||||
|
$entry[$i]['email_home_type'] = 'INTERNET';
|
||||||
|
$entry[$i]['adr_one_type'] = 'intl';
|
||||||
|
$entry[$i]['adr_two_type'] = 'intl';
|
||||||
|
//echo '<br>';
|
||||||
|
//$contacts->add($phpgw_info["user"]["account_id"],$entry[$i]);
|
||||||
|
}
|
||||||
|
$num = $i - 1;
|
||||||
|
return "Successfully imported $num records into your addressbook.";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user