diff --git a/addressbook/import.php b/addressbook/import.php index 1f9108393b..feedb6b99e 100644 --- a/addressbook/import.php +++ b/addressbook/import.php @@ -52,11 +52,14 @@ } $t->set_var("lang_cancel",lang("Cancel")); - $t->set_var("cancel_url",$phpgw->link("/addressbook/index.php")); + $t->set_var("lang_cat",lang("Select Category")); + $t->set_var("cancel_url",$phpgw->link("/addressbook/index.php", + "sort=$sort&order=$order&filter=$filter&start=$start&query=$query&cat_id=$cat_id")); $t->set_var("navbar_bg",$phpgw_info["theme"]["navbar_bg"]); $t->set_var("navbar_text",$phpgw_info["theme"]["navbar_text"]); - $t->set_var("import_text",lang("Import from Outlook (CSV) or Netscape (LDIF)")); + $t->set_var("import_text",lang("Import from LDIF, CSV, or VCard")); $t->set_var("action_url",$phpgw->link("/addressbook/import.php")); + $t->set_var("cat_id",cat_option($cat_id,True)); $t->set_var("tsvfilename",""); $t->set_var("conv",$conv); $t->set_var("debug",lang("Debug output in browser")); @@ -148,13 +151,13 @@ } } } else { - $buffer = $this->import_end_record($buffer,$private); + $buffer = $this->import_end_record($buffer); } } } fclose($fp); - $buffer = $this->import_end_file($buffer); + $buffer = $this->import_end_file($buffer,$private,$cat_id); if ($download == "") { if($conv_type=="Debug LDAP" || $conv_type=="Debug SQL" ) { diff --git a/addressbook/import/Import_from_Netscape b/addressbook/import/Import_from_Netscape index 89655428f5..d24edb47dc 100644 --- a/addressbook/import/Import_from_Netscape +++ b/addressbook/import/Import_from_Netscape @@ -70,18 +70,17 @@ return $buffer; } - function import_end_record($buffer,$private="private") { + function import_end_record($buffer) { global $phpgw_info; $buffer[$this->id]=""; while ( list($name, $value) = each($this->currentrecord)) { $buffer[$this->id][$name] = $value; //echo '
'.$this->id.': '.$name.' => '.$value; } - $buffer[$this->id]['access'] = $private; return $buffer; } - function import_end_file($buffer) { + function import_end_file($buffer,$access="private",$cat_id=0) { global $phpgw,$phpgw_info; $contacts = CreateObject("phpgwapi.contacts"); @@ -96,7 +95,7 @@ $entry[$i]['adr_one_type'] = 'intl'; $entry[$i]['adr_two_type'] = 'intl'; //echo '
'; - $contacts->add($phpgw_info["user"]["account_id"],$entry[$i]); + $contacts->add($phpgw_info["user"]["account_id"],$entry[$i],$access,$cat_id); } $num = $i - 1; return "Successfully imported $num records into your addressbook."; diff --git a/addressbook/import/Import_from_Outlook b/addressbook/import/Import_from_Outlook index e0b4321faa..269cccb72b 100644 --- a/addressbook/import/Import_from_Outlook +++ b/addressbook/import/Import_from_Outlook @@ -136,18 +136,17 @@ return $buffer; } - function import_end_record($buffer,$private="private") { + function import_end_record($buffer) { global $phpgw_info; $buffer[$this->id]=""; while ( list($name, $value) = each($this->currentrecord)) { $buffer[$this->id][$name] = $value; //echo '
'.$name.' => '.$value; } - $buffer[$this->id]['access'] = $private; return $buffer; } - function import_end_file($buffer) { + function import_end_file($buffer,$access="private",$cat_id=0) { global $phpgw,$phpgw_info; $contacts = CreateObject("phpgwapi.contacts"); @@ -162,7 +161,7 @@ $entry[$i]['adr_one_type'] = 'intl'; $entry[$i]['adr_two_type'] = 'intl'; //echo '
'; - $contacts->add($phpgw_info["user"]["account_id"],$entry[$i]); + $contacts->add($phpgw_info["user"]["account_id"],$entry[$i],$access,$cat_id); } $num = $i - 1; return "Successfully imported $num records into your addressbook."; diff --git a/addressbook/import/Import_from_VCard b/addressbook/import/Import_from_VCard index 44d8532643..ed357b4aa8 100644 --- a/addressbook/import/Import_from_VCard +++ b/addressbook/import/Import_from_VCard @@ -59,7 +59,7 @@ return $buffer; } - function import_end_record($buffer,$private="private") { + function import_end_record($buffer) { global $phpgw_info; $buffer[$this->id]=""; while ( list($name, $value) = each($this->currentrecord)) { @@ -67,11 +67,10 @@ //$buffer[$this->id]["private"] = $private; //echo '
'.$name.' => '.$value; } - $buffer[$this->id]['access'] = $private; return $buffer; } - function import_end_file($buffer) { + function import_end_file($buffer,$access="private",$cat_id=0) { global $phpgw,$phpgw_info; for ($i=1;$i<=count($buffer);$i++) { @@ -80,7 +79,7 @@ // bogus values that get stuffed in. $entry = $this->vcard->in($buffer[$i]); // Now actually add the new entry - $this->contacts->add($phpgw_info["user"]["account_id"],$entry); + $this->contacts->add($phpgw_info["user"]["account_id"],$entry,$access,$cat_id); } $num = $i - 1; return "Successfully imported $num records into your addressbook."; diff --git a/addressbook/import/Debug_Netscape_to_LDAP b/addressbook/import/debug/Debug_Netscape_to_LDAP similarity index 100% rename from addressbook/import/Debug_Netscape_to_LDAP rename to addressbook/import/debug/Debug_Netscape_to_LDAP diff --git a/addressbook/import/Debug_Netscape_to_SQL b/addressbook/import/debug/Debug_Netscape_to_SQL similarity index 100% rename from addressbook/import/Debug_Netscape_to_SQL rename to addressbook/import/debug/Debug_Netscape_to_SQL diff --git a/addressbook/import/Debug_Outlook_to_LDAP b/addressbook/import/debug/Debug_Outlook_to_LDAP similarity index 100% rename from addressbook/import/Debug_Outlook_to_LDAP rename to addressbook/import/debug/Debug_Outlook_to_LDAP diff --git a/addressbook/import/Debug_Outlook_to_SQL b/addressbook/import/debug/Debug_Outlook_to_SQL similarity index 100% rename from addressbook/import/Debug_Outlook_to_SQL rename to addressbook/import/debug/Debug_Outlook_to_SQL diff --git a/addressbook/templates/default/import.tpl b/addressbook/templates/default/import.tpl index 22e40f6ae1..175502ce2e 100644 --- a/addressbook/templates/default/import.tpl +++ b/addressbook/templates/default/import.tpl @@ -12,21 +12,24 @@
    -
  1. In Outlook, select your Contacts folder, select Import +
  2. In Netscape, open the Addressbook and select Export from the File menu. + The file exported will be in LDIF format. +

    Or, in Outlook, select your Contacts folder, select Import and Export... from the File - menu and export your contacts into a comma separated text file. -

    Or, in Netscape, open the Addressbook and select Export from the File menu. - The file exported will be in LDIF format.

    + menu and export your contacts into a comma separated text (CSV) file. +

    Or, in Palm Desktop 4.0 or greater, visit your addressbook and select Export from the File menu. + The file exported will be in VCard format.

  3. Enter the path to the exported file here:

  4. -
  5. Select the type of conversion (Import types will perform an actual import. Debug will display output in browser or via a download.):
    +
  6. Select the type of conversion:

  7. -
  8. Debug output in browser (Uncheck to download output.)
  9. +
  10. {lang_cat}:{cat_id}
  11. Mark records as private
  12. +
  13. Debug output in browser