From 3833790db4dee8607b31c84f26eb0e95bae4c906 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 16 Nov 2012 13:22:10 +0100 Subject: Support contacts import from CSV file (#1486399) --- program/include/rcube_csv2vcard.php | 351 ++++++++++++++++++++++++++++++++++++ 1 file changed, 351 insertions(+) create mode 100644 program/include/rcube_csv2vcard.php (limited to 'program/include/rcube_csv2vcard.php') diff --git a/program/include/rcube_csv2vcard.php b/program/include/rcube_csv2vcard.php new file mode 100644 index 000000000..f84108ded --- /dev/null +++ b/program/include/rcube_csv2vcard.php @@ -0,0 +1,351 @@ + | + +-----------------------------------------------------------------------+ +*/ + +/** + * CSV to vCard data converter + * + * @package Roundcube Framework + * @author Aleksander Machniak + */ +class rcube_csv2vcard +{ + /** + * CSV to vCard fields mapping + * + * @var array + */ + protected $csv2vcard_map = array( + // MS Outlook 2010 + 'anniversary' => 'anniversary', + 'assistants_name' => 'assistant', + 'assistants_phone' => 'phone:assistant', + 'birthday' => 'birthday', + 'business_city' => 'locality:work', + 'business_countryregion' => 'country:work', + 'business_fax' => 'phone:work,fax', + 'business_phone' => 'phone:work', + 'business_phone_2' => 'phone:work2', + 'business_postal_code' => 'zipcode:work', + 'business_state' => 'region:work', + 'business_street' => 'street:work', + //'business_street_2' => '', + //'business_street_3' => '', + 'car_phone' => 'phone:car', + 'categories' => 'categories', + //'children' => '', + 'company' => 'organization', + //'company_main_phone' => '', + 'department' => 'department', + //'email_2_address' => '', //@TODO + //'email_2_type' => '', //@TODO + //'email_3_address' => '', //@TODO + //'email_3_type' => '', //@TODO + 'email_address' => 'email:main', + //'email_type' => '', //@TODO + 'first_name' => 'firstname', + 'gender' => 'gender', + 'home_city' => 'locality:home', + 'home_countryregion' => 'country:home', + 'home_fax' => 'phone:home,fax', + 'home_phone' => 'phone:home', + 'home_phone_2' => 'phone:home2', + 'home_postal_code' => 'zipcode:home', + 'home_state' => 'region:home', + 'home_street' => 'street:home', + //'home_street_2' => '', + //'home_street_3' => '', + //'initials' => '', + //'isdn' => '', + 'job_title' => 'jobtitle', + //'keywords' => '', + //'language' => '', + 'last_name' => 'surname', + //'location' => '', + 'managers_name' => 'manager', + 'middle_name' => 'middlename', + //'mileage' => '', + 'mobile_phone' => 'phone:cell', + 'notes' => 'notes', + //'office_location' => '', + 'other_city' => 'locality:other', + 'other_countryregion' => 'country:other', + 'other_fax' => 'phone:other,fax', + 'other_phone' => 'phone:other', + 'other_postal_code' => 'zipcode:other', + 'other_state' => 'region:other', + 'other_street' => 'street:other', + //'other_street_2' => '', + //'other_street_3' => '', + 'pager' => 'phone:pager', + 'primary_phone' => 'phone:pref', + //'profession' => '', + //'radio_phone' => '', + 'spouse' => 'spouse', + 'suffix' => 'suffix', + 'title' => 'title', + 'web_page' => 'website:homepage', + + // Thunderbird + 'birth_day' => 'birthday-d', + 'birth_month' => 'birthday-m', + 'birth_year' => 'birthday-y', + 'display_name' => 'displayname', + 'fax_number' => 'phone:fax', + 'home_address' => 'street:home', + //'home_address_2' => '', + 'home_country' => 'country:home', + 'home_zipcode' => 'zipcode:home', + 'mobile_number' => 'phone:cell', + 'nickname' => 'nickname', + 'organization' => 'organization', + 'pager_number' => 'phone:pager', + 'primary_email' => 'email:pref', + 'secondary_email' => 'email:other', + 'web_page_1' => 'website:homepage', + 'web_page_2' => 'website:other', + 'work_phone' => 'phone:work', + 'work_address' => 'street:work', + //'work_address_2' => '', + 'work_country' => 'country:work', + 'work_zipcode' => 'zipcode:work', + ); + + /** + * CSV label to text mapping for English + * + * @var array + */ + protected $label_map = array( + // MS Outlook 2010 + 'anniversary' => "Anniversary", + 'assistants_name' => "Assistant's Name", + 'assistants_phone' => "Assistant's Phone", + 'birthday' => "Birthday", + 'business_city' => "Business City", + 'business_countryregion' => "Business Country/Region", + 'business_fax' => "Business Fax", + 'business_phone' => "Business Phone", + 'business_phone_2' => "Business Phone 2", + 'business_postal_code' => "Business Postal Code", + 'business_state' => "Business State", + 'business_street' => "Business Street", + //'business_street_2' => "Business Street 2", + //'business_street_3' => "Business Street 3", + 'car_phone' => "Car Phone", + 'categories' => "Categories", + //'children' => "Children", + 'company' => "Company", + //'company_main_phone' => "Company Main Phone", + 'department' => "Department", + //'directory_server' => "Directory Server", + //'email_2_address' => "E-mail 2 Address", //@TODO + //'email_2_type' => "E-mail 2 Type", //@TODO + //'email_3_address' => "E-mail 3 Address", //@TODO + //'email_3_type' => "E-mail 3 Type", //@TODO + 'email_address' => "E-mail Address", + //'email_type' => "E-mail Type", //@TODO + 'first_name' => "First Name", + 'gender' => "Gender", + 'home_city' => "Home City", + 'home_countryregion' => "Home Country/Region", + 'home_fax' => "Home Fax", + 'home_phone' => "Home Phone", + 'home_phone_2' => "Home Phone 2", + 'home_postal_code' => "Home Postal Code", + 'home_state' => "Home State", + 'home_street' => "Home Street", + //'home_street_2' => "Home Street 2", + //'home_street_3' => "Home Street 3", + //'initials' => "Initials", + //'isdn' => "ISDN", + 'job_title' => "Job Title", + //'keywords' => "Keywords", + //'language' => "Language", + 'last_name' => "Last Name", + //'location' => "Location", + 'managers_name' => "Manager's Name", + 'middle_name' => "Middle Name", + //'mileage' => "Mileage", + 'mobile_phone' => "Mobile Phone", + 'notes' => "Notes", + //'office_location' => "Office Location", + 'other_city' => "Other City", + 'other_countryregion' => "Other Country/Region", + 'other_fax' => "Other Fax", + 'other_phone' => "Other Phone", + 'other_postal_code' => "Other Postal Code", + 'other_state' => "Other State", + 'other_street' => "Other Street", + //'other_street_2' => "Other Street 2", + //'other_street_3' => "Other Street 3", + 'pager' => "Pager", + 'primary_phone' => "Primary Phone", + //'profession' => "Profession", + //'radio_phone' => "Radio Phone", + 'spouse' => "Spouse", + 'suffix' => "Suffix", + 'title' => "Title", + 'web_page' => "Web Page", + + // Thunderbird + 'birth_day' => "Birth Day", + 'birth_month' => "Birth Month", + 'birth_year' => "Birth Year", + 'display_name' => "Display Name", + 'fax_number' => "Fax Number", + 'home_address' => "Home Address", + //'home_address_2' => "Home Address 2", + 'home_country' => "Home Country", + 'home_zipcode' => "Home ZipCode", + 'mobile_number' => "Mobile Number", + 'nickname' => "Nickname", + 'organization' => "Organization", + 'pager_number' => "Pager Namber", + 'primary_email' => "Primary Email", + 'secondary_email' => "Secondary Email", + 'web_page_1' => "Web Page 1", + 'web_page_2' => "Web Page 2", + 'work_phone' => "Work Phone", + 'work_address' => "Work Address", + //'work_address_2' => "Work Address 2", + 'work_country' => "Work Country", + 'work_zipcode' => "Work ZipCode", + ); + + protected $vcards = array(); + protected $map = array(); + + + /** + * Class constructor + * + * @param string $lang File language + */ + public function __construct($lang = 'en_US') + { + // Localize fields map + if ($lang && $lang != 'en_US') { + if (file_exists(INSTALL_PATH . "program/localization/$lang/csv2vcard.inc")) { + include INSTALL_PATH . "program/localization/$lang/csv2vcard.inc"; + } + + if (!empty($map)) { + $this->label_map = array_merge($this->label_map, $map); + } + } + + $this->label_map = array_flip($this->label_map); + } + + /** + * + */ + public function import($csv) + { + // convert to UTF-8 + $head = substr($csv, 0, 4096); + $fallback = rcube::get_instance()->config->get('default_charset', 'ISO-8859-1'); // fallback to Latin-1? + $charset = rcube_charset::detect($head, RCMAIL_CHARSET); + $csv = rcube_charset::convert($csv, $charset); + $head = ''; + + $this->map = array(); + + // Parse file + foreach (preg_split("/[\r\n]+/", $csv) as $i => $line) { + $line = trim($line); + if (empty($line)) { + continue; + } + + $elements = rcube_utils::explode_quoted_string(',', $line); + + if (empty($elements)) { + continue; + } + + // Parse header + if (empty($this->map)) { + $this->parse_header($elements); + if (empty($this->map)) { + break; + } + } + // Parse data row + else { + $this->csv_to_vcard($elements); + } + } + } + + /** + * @return array rcube_vcard List of vcards + */ + public function export() + { + return $this->vcards; + } + + /** + * Parse CSV header line, detect fields mapping + */ + protected function parse_header($elements) + { + for ($i = 0, $size = count($elements); $i<$size; $i++) { + $label = $this->label_map[$elements[$i]]; + if ($label && !empty($this->csv2vcard_map[$label])) { + $this->map[$i] = $this->csv2vcard_map[$label]; + } + } + } + + /** + * Convert CSV data row to vCard + */ + protected function csv_to_vcard($data) + { + $contact = array(); + foreach ($this->map as $idx => $name) { + $value = $data[$idx]; + if ($value !== null && $value !== '') { + $contact[$name] = $value; + } + } + + if (empty($contact)) { + return; + } + + // Handle special values + if (!empty($contact['birthday-d']) && !empty($contact['birthday-m']) && !empty($contact['birthday-y'])) { + $contact['birthday'] = $contact['birthday-y'] .'-' .$contact['birthday-m'] . '-' . $contact['birthday-d']; + } + + // Create vcard object + $vcard = new rcube_vcard(); + foreach ($contact as $name => $value) { + $name = explode(':', $name); + $vcard->set($name[0], $value, $name[1]); + } + + // add to the list + $this->vcards[] = $vcard; + } +} -- cgit v1.2.3 From c66b605435cae82f8d61329aed79f514d771ab7a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 16 Nov 2012 14:45:02 +0100 Subject: Add more data validation --- program/include/rcube_csv2vcard.php | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'program/include/rcube_csv2vcard.php') diff --git a/program/include/rcube_csv2vcard.php b/program/include/rcube_csv2vcard.php index f84108ded..bde8198ba 100644 --- a/program/include/rcube_csv2vcard.php +++ b/program/include/rcube_csv2vcard.php @@ -54,11 +54,11 @@ class rcube_csv2vcard //'company_main_phone' => '', 'department' => 'department', //'email_2_address' => '', //@TODO - //'email_2_type' => '', //@TODO + //'email_2_type' => '', //'email_3_address' => '', //@TODO - //'email_3_type' => '', //@TODO + //'email_3_type' => '', 'email_address' => 'email:main', - //'email_type' => '', //@TODO + //'email_type' => '', 'first_name' => 'firstname', 'gender' => 'gender', 'home_city' => 'locality:home', @@ -155,12 +155,12 @@ class rcube_csv2vcard //'company_main_phone' => "Company Main Phone", 'department' => "Department", //'directory_server' => "Directory Server", - //'email_2_address' => "E-mail 2 Address", //@TODO - //'email_2_type' => "E-mail 2 Type", //@TODO - //'email_3_address' => "E-mail 3 Address", //@TODO - //'email_3_type' => "E-mail 3 Type", //@TODO + //'email_2_address' => "E-mail 2 Address", + //'email_2_type' => "E-mail 2 Type", + //'email_3_address' => "E-mail 3 Address", + //'email_3_type' => "E-mail 3 Type", 'email_address' => "E-mail Address", - //'email_type' => "E-mail Type", //@TODO + //'email_type' => "E-mail Type", 'first_name' => "First Name", 'gender' => "Gender", 'home_city' => "Home City", @@ -338,6 +338,18 @@ class rcube_csv2vcard $contact['birthday'] = $contact['birthday-y'] .'-' .$contact['birthday-m'] . '-' . $contact['birthday-d']; } + foreach (array('birthday', 'anniversary') as $key) { + if (!empty($contact[$key]) && $contact[$key] == '0/0/00') { // @TODO: localization? + unset($contact[$key]); + } + } + + if (!empty($contact['gender']) && ($gender = strtolower($contact['gender']))) { + if (!in_array($gender, array('male', 'female'))) { + unset($contact['gender']); + } + } + // Create vcard object $vcard = new rcube_vcard(); foreach ($contact as $name => $value) { -- cgit v1.2.3 From 92bd3a7c3f60e56ec5055c96e7b2f25637d4b0ca Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 17 Nov 2012 09:04:45 +0100 Subject: Fix parsing header in English when localized map is defined --- program/include/rcube_csv2vcard.php | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) (limited to 'program/include/rcube_csv2vcard.php') diff --git a/program/include/rcube_csv2vcard.php b/program/include/rcube_csv2vcard.php index bde8198ba..6ec2158be 100644 --- a/program/include/rcube_csv2vcard.php +++ b/program/include/rcube_csv2vcard.php @@ -229,8 +229,9 @@ class rcube_csv2vcard 'work_zipcode' => "Work ZipCode", ); + protected $local_label_map = array(); protected $vcards = array(); - protected $map = array(); + protected $map = array(); /** @@ -247,11 +248,12 @@ class rcube_csv2vcard } if (!empty($map)) { - $this->label_map = array_merge($this->label_map, $map); + $this->local_label_map = array_merge($this->label_map, $map); } } $this->label_map = array_flip($this->label_map); + $this->local_label_map = array_flip($this->local_label_map); } /** @@ -307,13 +309,29 @@ class rcube_csv2vcard * Parse CSV header line, detect fields mapping */ protected function parse_header($elements) - { - for ($i = 0, $size = count($elements); $i<$size; $i++) { + { + $map1 = array(); + $map2 = array(); + $size = count($elements); + + // check English labels + for ($i = 0; $i < $size; $i++) { $label = $this->label_map[$elements[$i]]; if ($label && !empty($this->csv2vcard_map[$label])) { - $this->map[$i] = $this->csv2vcard_map[$label]; + $map1[$i] = $this->csv2vcard_map[$label]; + } + } + // check localized labels + if (!empty($this->local_label_map)) { + for ($i = 0; $i < $size; $i++) { + $label = $this->local_label_map[$elements[$i]]; + if ($label && !empty($this->csv2vcard_map[$label])) { + $map2[$i] = $this->csv2vcard_map[$label]; + } } } + + $this->map = count($map1) >= count($map2) ? $map1 : $map2; } /** -- cgit v1.2.3 From 9ab34604d94270f6c1795c7dd7b615273d05db0c Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Sat, 17 Nov 2012 09:24:05 +0100 Subject: Define @package and @subpackage of Framework classes --- program/include/html.php | 3 ++- program/include/rcube_addressbook.php | 3 ++- program/include/rcube_base_replacer.php | 5 +++-- program/include/rcube_browser.php | 3 ++- program/include/rcube_cache.php | 4 ++-- program/include/rcube_charset.php | 9 +++++---- program/include/rcube_config.php | 3 ++- program/include/rcube_contacts.php | 3 ++- program/include/rcube_content_filter.php | 3 +++ program/include/rcube_csv2vcard.php | 5 +++-- program/include/rcube_db.php | 9 ++++----- program/include/rcube_db_mssql.php | 5 ++--- program/include/rcube_db_mysql.php | 4 ++-- program/include/rcube_db_pgsql.php | 5 ++--- program/include/rcube_db_sqlite.php | 5 ++--- program/include/rcube_db_sqlsrv.php | 5 ++--- program/include/rcube_image.php | 6 ++++++ program/include/rcube_imap.php | 4 ++-- program/include/rcube_imap_cache.php | 4 ++-- program/include/rcube_imap_generic.php | 4 ++-- program/include/rcube_ldap.php | 5 +++-- program/include/rcube_message.php | 3 ++- program/include/rcube_message_header.php | 5 +++-- program/include/rcube_message_part.php | 4 ++-- program/include/rcube_mime.php | 7 ++++--- program/include/rcube_output.php | 3 ++- program/include/rcube_output_html.php | 3 ++- program/include/rcube_output_json.php | 3 ++- program/include/rcube_plugin.php | 3 ++- program/include/rcube_plugin_api.php | 3 ++- program/include/rcube_result_index.php | 3 +++ program/include/rcube_result_set.php | 3 ++- program/include/rcube_result_thread.php | 3 +++ program/include/rcube_session.php | 3 ++- program/include/rcube_shared.inc | 3 ++- program/include/rcube_smtp.php | 3 ++- program/include/rcube_spellchecker.php | 3 ++- program/include/rcube_storage.php | 8 ++++---- program/include/rcube_string_replacer.php | 3 ++- program/include/rcube_user.php | 7 ++++--- program/include/rcube_utils.php | 3 ++- program/include/rcube_vcard.php | 7 ++++--- 42 files changed, 108 insertions(+), 72 deletions(-) (limited to 'program/include/rcube_csv2vcard.php') diff --git a/program/include/html.php b/program/include/html.php index 0f93e969d..8ff685a84 100644 --- a/program/include/html.php +++ b/program/include/html.php @@ -23,7 +23,8 @@ /** * Class for HTML code creation * - * @package HTML + * @package Framework + * @subpackage HTML */ class html { diff --git a/program/include/rcube_addressbook.php b/program/include/rcube_addressbook.php index 892ae263a..b5fb8cf43 100644 --- a/program/include/rcube_addressbook.php +++ b/program/include/rcube_addressbook.php @@ -23,7 +23,8 @@ /** * Abstract skeleton of an address book/repository * - * @package Addressbook + * @package Framework + * @subpackage Addressbook */ abstract class rcube_addressbook { diff --git a/program/include/rcube_base_replacer.php b/program/include/rcube_base_replacer.php index 4ec367552..b2a0fc13c 100644 --- a/program/include/rcube_base_replacer.php +++ b/program/include/rcube_base_replacer.php @@ -23,8 +23,9 @@ * Helper class to turn relative urls into absolute ones * using a predefined base * - * @package Core - * @author Thomas Bruederli + * @package Framework + * @subpackage Core + * @author Thomas Bruederli */ class rcube_base_replacer { diff --git a/program/include/rcube_browser.php b/program/include/rcube_browser.php index 7cfae709d..154e7ef4e 100644 --- a/program/include/rcube_browser.php +++ b/program/include/rcube_browser.php @@ -22,7 +22,8 @@ /** * Provide details about the client's browser based on the User-Agent header * - * @package Core + * @package Framework + * @subpackage Core */ class rcube_browser { diff --git a/program/include/rcube_cache.php b/program/include/rcube_cache.php index 4e60deaff..3e1ce4fc8 100644 --- a/program/include/rcube_cache.php +++ b/program/include/rcube_cache.php @@ -25,10 +25,10 @@ /** * Interface class for accessing Roundcube cache * - * @package Cache + * @package Framework + * @subpackage Cache * @author Thomas Bruederli * @author Aleksander Machniak - * @version 1.1 */ class rcube_cache { diff --git a/program/include/rcube_charset.php b/program/include/rcube_charset.php index 4d24ed135..e8cce00e3 100644 --- a/program/include/rcube_charset.php +++ b/program/include/rcube_charset.php @@ -25,10 +25,11 @@ /** * Character sets conversion functionality * - * @package Core - * @author Thomas Bruederli - * @author Aleksander Machniak - * @author Edmund Grimley Evans + * @package Framework + * @subpackage Core + * @author Thomas Bruederli + * @author Aleksander Machniak + * @author Edmund Grimley Evans */ class rcube_charset { diff --git a/program/include/rcube_config.php b/program/include/rcube_config.php index bbc3e9c6e..dab539412 100644 --- a/program/include/rcube_config.php +++ b/program/include/rcube_config.php @@ -22,7 +22,8 @@ /** * Configuration class for Roundcube * - * @package Core + * @package Framework + * @subpackage Core */ class rcube_config { diff --git a/program/include/rcube_contacts.php b/program/include/rcube_contacts.php index 534a65cb9..e4500c744 100644 --- a/program/include/rcube_contacts.php +++ b/program/include/rcube_contacts.php @@ -23,7 +23,8 @@ /** * Model class for the local address book database * - * @package Addressbook + * @package Framework + * @subpackage Addressbook */ class rcube_contacts extends rcube_addressbook { diff --git a/program/include/rcube_content_filter.php b/program/include/rcube_content_filter.php index 36e61a271..99916a300 100644 --- a/program/include/rcube_content_filter.php +++ b/program/include/rcube_content_filter.php @@ -21,6 +21,9 @@ /** * PHP stream filter to detect html/javascript code in attachments + * + * @package Framework + * @subpackage Core */ class rcube_content_filter extends php_user_filter { diff --git a/program/include/rcube_csv2vcard.php b/program/include/rcube_csv2vcard.php index 6ec2158be..114d36d85 100644 --- a/program/include/rcube_csv2vcard.php +++ b/program/include/rcube_csv2vcard.php @@ -21,8 +21,9 @@ /** * CSV to vCard data converter * - * @package Roundcube Framework - * @author Aleksander Machniak + * @package Framework + * @subpackage Addressbook + * @author Aleksander Machniak */ class rcube_csv2vcard { diff --git a/program/include/rcube_db.php b/program/include/rcube_db.php index b066101b3..5d8c4a534 100644 --- a/program/include/rcube_db.php +++ b/program/include/rcube_db.php @@ -21,12 +21,11 @@ /** - * Database independent query interface + * Database independent query interface. + * This is a wrapper for the PHP PDO. * - * This is a wrapper for the PHP PDO - * - * @package Database - * @version 1.0 + * @package Framework + * @sbpackage Database */ class rcube_db { diff --git a/program/include/rcube_db_mssql.php b/program/include/rcube_db_mssql.php index 119647d95..c95663c74 100644 --- a/program/include/rcube_db_mssql.php +++ b/program/include/rcube_db_mssql.php @@ -23,11 +23,10 @@ /** * Database independent query interface - * * This is a wrapper for the PHP PDO * - * @package Database - * @version 1.0 + * @package Framework + * @subpackage Database */ class rcube_db_mssql extends rcube_db { diff --git a/program/include/rcube_db_mysql.php b/program/include/rcube_db_mysql.php index 6f0acba54..1c5ba1de7 100644 --- a/program/include/rcube_db_mysql.php +++ b/program/include/rcube_db_mysql.php @@ -26,8 +26,8 @@ * * This is a wrapper for the PHP PDO * - * @package Database - * @version 1.0 + * @package Framework + * @subpackage Database */ class rcube_db_mysql extends rcube_db { diff --git a/program/include/rcube_db_pgsql.php b/program/include/rcube_db_pgsql.php index 0d0caadde..797860a84 100644 --- a/program/include/rcube_db_pgsql.php +++ b/program/include/rcube_db_pgsql.php @@ -23,11 +23,10 @@ /** * Database independent query interface - * * This is a wrapper for the PHP PDO * - * @package Database - * @version 1.0 + * @package Framework + * @subpackage Database */ class rcube_db_pgsql extends rcube_db { diff --git a/program/include/rcube_db_sqlite.php b/program/include/rcube_db_sqlite.php index a7397674b..9aa67d0fd 100644 --- a/program/include/rcube_db_sqlite.php +++ b/program/include/rcube_db_sqlite.php @@ -23,11 +23,10 @@ /** * Database independent query interface - * * This is a wrapper for the PHP PDO * - * @package Database - * @version 1.0 + * @package Framework + * @subpackage Database */ class rcube_db_sqlite extends rcube_db { diff --git a/program/include/rcube_db_sqlsrv.php b/program/include/rcube_db_sqlsrv.php index e58bf0704..8b6ffe807 100644 --- a/program/include/rcube_db_sqlsrv.php +++ b/program/include/rcube_db_sqlsrv.php @@ -23,11 +23,10 @@ /** * Database independent query interface - * * This is a wrapper for the PHP PDO * - * @package Database - * @version 1.0 + * @package Framework + * @subpackage Database */ class rcube_db_sqlsrv extends rcube_db { diff --git a/program/include/rcube_image.php b/program/include/rcube_image.php index c0d4e878d..b72a24c51 100644 --- a/program/include/rcube_image.php +++ b/program/include/rcube_image.php @@ -21,6 +21,12 @@ +-----------------------------------------------------------------------+ */ +/** + * Image resizer and converter + * + * @package Framework + * @subpackage Utils + */ class rcube_image { private $image_file; diff --git a/program/include/rcube_imap.php b/program/include/rcube_imap.php index f2645f60f..9054b6bab 100644 --- a/program/include/rcube_imap.php +++ b/program/include/rcube_imap.php @@ -25,10 +25,10 @@ /** * Interface class for accessing an IMAP server * - * @package Mail + * @package Framework + * @subpackage Storage * @author Thomas Bruederli * @author Aleksander Machniak - * @version 2.0 */ class rcube_imap extends rcube_storage { diff --git a/program/include/rcube_imap_cache.php b/program/include/rcube_imap_cache.php index f36ace0eb..31214cfbf 100644 --- a/program/include/rcube_imap_cache.php +++ b/program/include/rcube_imap_cache.php @@ -24,10 +24,10 @@ /** * Interface class for accessing Roundcube messages cache * - * @package Cache + * @package Framework + * @subpackage Storage * @author Thomas Bruederli * @author Aleksander Machniak - * @version 1.0 */ class rcube_imap_cache { diff --git a/program/include/rcube_imap_generic.php b/program/include/rcube_imap_generic.php index bc7ecfc37..a0a8f3b77 100644 --- a/program/include/rcube_imap_generic.php +++ b/program/include/rcube_imap_generic.php @@ -30,8 +30,8 @@ /** * PHP based wrapper class to connect to an IMAP server * - * @package Mail - * @author Aleksander Machniak + * @package Framework + * @subpackage Storage */ class rcube_imap_generic { diff --git a/program/include/rcube_ldap.php b/program/include/rcube_ldap.php index 7cef25556..34e37e3b9 100644 --- a/program/include/rcube_ldap.php +++ b/program/include/rcube_ldap.php @@ -6,7 +6,7 @@ | | | This file is part of the Roundcube Webmail client | | Copyright (C) 2006-2012, The Roundcube Dev Team | - | Copyright (C) 2011, Kolab Systems AG | + | Copyright (C) 2011-2012, Kolab Systems AG | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -26,7 +26,8 @@ /** * Model class to access an LDAP address directory * - * @package Addressbook + * @package Framework + * @subpackage Addressbook */ class rcube_ldap extends rcube_addressbook { diff --git a/program/include/rcube_message.php b/program/include/rcube_message.php index 74bf4574f..87319f04f 100644 --- a/program/include/rcube_message.php +++ b/program/include/rcube_message.php @@ -24,7 +24,8 @@ * Logical representation of a mail message with all its data * and related functions * - * @package Mail + * @package Framework + * @subpackage Storage * @author Thomas Bruederli */ class rcube_message diff --git a/program/include/rcube_message_header.php b/program/include/rcube_message_header.php index 378fb98c9..db82247f9 100644 --- a/program/include/rcube_message_header.php +++ b/program/include/rcube_message_header.php @@ -23,8 +23,9 @@ /** * Struct representing an e-mail message header * - * @package Mail - * @author Aleksander Machniak + * @package Framework + * @subpackage Storage + * @author Aleksander Machniak */ class rcube_message_header { diff --git a/program/include/rcube_message_part.php b/program/include/rcube_message_part.php index 80a019e50..c9c9257eb 100644 --- a/program/include/rcube_message_part.php +++ b/program/include/rcube_message_part.php @@ -25,10 +25,10 @@ /** * Class representing a message part * - * @package Mail + * @package Framework + * @subpackage Storage * @author Thomas Bruederli * @author Aleksander Machniak - * @version 2.0 */ class rcube_message_part { diff --git a/program/include/rcube_mime.php b/program/include/rcube_mime.php index d8e04a97c..2dbeaf67a 100644 --- a/program/include/rcube_mime.php +++ b/program/include/rcube_mime.php @@ -25,9 +25,10 @@ /** * Class for parsing MIME messages * - * @package Mail - * @author Thomas Bruederli - * @author Aleksander Machniak + * @package Framework + * @subpackage Storage + * @author Thomas Bruederli + * @author Aleksander Machniak */ class rcube_mime { diff --git a/program/include/rcube_output.php b/program/include/rcube_output.php index 5c582e67c..f7ac3002f 100644 --- a/program/include/rcube_output.php +++ b/program/include/rcube_output.php @@ -22,7 +22,8 @@ /** * Class for output generation * - * @package HTML + * @package Framework + * @subpackage View */ abstract class rcube_output { diff --git a/program/include/rcube_output_html.php b/program/include/rcube_output_html.php index ac07d58e9..ffb5db4da 100644 --- a/program/include/rcube_output_html.php +++ b/program/include/rcube_output_html.php @@ -23,7 +23,8 @@ /** * Class to create HTML page output using a skin template * - * @package View + * @package Framework + * @subpackage View */ class rcube_output_html extends rcube_output { diff --git a/program/include/rcube_output_json.php b/program/include/rcube_output_json.php index eb1a9380d..fcd52c789 100644 --- a/program/include/rcube_output_json.php +++ b/program/include/rcube_output_json.php @@ -23,7 +23,8 @@ /** * View class to produce JSON responses * - * @package View + * @package Framework + * @subpackage View */ class rcube_output_json extends rcube_output { diff --git a/program/include/rcube_plugin.php b/program/include/rcube_plugin.php index 45088850a..dbb15e8be 100644 --- a/program/include/rcube_plugin.php +++ b/program/include/rcube_plugin.php @@ -22,7 +22,8 @@ /** * Plugin interface class * - * @package PluginAPI + * @package Framework + * @subpackage PluginAPI */ abstract class rcube_plugin { diff --git a/program/include/rcube_plugin_api.php b/program/include/rcube_plugin_api.php index c473b0b17..51daf2797 100644 --- a/program/include/rcube_plugin_api.php +++ b/program/include/rcube_plugin_api.php @@ -27,7 +27,8 @@ if (!defined('RCMAIL_PLUGINS_DIR')) /** * The plugin loader and global API * - * @package PluginAPI + * @package Framework + * @subpackage PluginAPI */ class rcube_plugin_api { diff --git a/program/include/rcube_result_index.php b/program/include/rcube_result_index.php index 334ec8530..4d1ae13b6 100644 --- a/program/include/rcube_result_index.php +++ b/program/include/rcube_result_index.php @@ -24,6 +24,9 @@ /** * Class for accessing IMAP's SORT/SEARCH/ESEARCH result + * + * @package Framework + * @subpackage Storage */ class rcube_result_index { diff --git a/program/include/rcube_result_set.php b/program/include/rcube_result_set.php index 809d8743f..456d1c9d6 100644 --- a/program/include/rcube_result_set.php +++ b/program/include/rcube_result_set.php @@ -24,7 +24,8 @@ * Roundcube result set class. * Representing an address directory result set. * - * @package Addressbook + * @package Framework + * @subpackage Addressbook */ class rcube_result_set { diff --git a/program/include/rcube_result_thread.php b/program/include/rcube_result_thread.php index b2325a499..c609bdc39 100644 --- a/program/include/rcube_result_thread.php +++ b/program/include/rcube_result_thread.php @@ -24,6 +24,9 @@ /** * Class for accessing IMAP's THREAD result + * + * @package Framework + * @subpackage Storage */ class rcube_result_thread { diff --git a/program/include/rcube_session.php b/program/include/rcube_session.php index c71efa2aa..fdbf668ca 100644 --- a/program/include/rcube_session.php +++ b/program/include/rcube_session.php @@ -24,7 +24,8 @@ /** * Class to provide database supported session storage * - * @package Core + * @package Framework + * @subpackage Core * @author Thomas Bruederli * @author Aleksander Machniak */ diff --git a/program/include/rcube_shared.inc b/program/include/rcube_shared.inc index 4577c6df5..5105fe22f 100644 --- a/program/include/rcube_shared.inc +++ b/program/include/rcube_shared.inc @@ -23,7 +23,8 @@ /** * Roundcube shared functions * - * @package Core + * @package Framework + * @subpackage Core */ diff --git a/program/include/rcube_smtp.php b/program/include/rcube_smtp.php index b28be5206..490ea8ad6 100644 --- a/program/include/rcube_smtp.php +++ b/program/include/rcube_smtp.php @@ -25,7 +25,8 @@ define('SMTP_MIME_CRLF', "\r\n"); /** * Class to provide SMTP functionality using PEAR Net_SMTP * - * @package Mail + * @package Framework + * @subpackage Mail * @author Thomas Bruederli * @author Aleksander Machniak */ diff --git a/program/include/rcube_spellchecker.php b/program/include/rcube_spellchecker.php index 219dca780..30d15d721 100644 --- a/program/include/rcube_spellchecker.php +++ b/program/include/rcube_spellchecker.php @@ -25,7 +25,8 @@ /** * Helper class for spellchecking with Googielspell and PSpell support. * - * @package Core + * @package Framework + * @subpackage Utils */ class rcube_spellchecker { diff --git a/program/include/rcube_storage.php b/program/include/rcube_storage.php index 933ebcc25..1556aae41 100644 --- a/program/include/rcube_storage.php +++ b/program/include/rcube_storage.php @@ -25,10 +25,10 @@ /** * Abstract class for accessing mail messages storage server * - * @package Mail - * @author Thomas Bruederli - * @author Aleksander Machniak - * @version 2.0 + * @package Framework + * @subpackage Storage + * @author Thomas Bruederli + * @author Aleksander Machniak */ abstract class rcube_storage { diff --git a/program/include/rcube_string_replacer.php b/program/include/rcube_string_replacer.php index edb2ac34f..9af6b33e0 100644 --- a/program/include/rcube_string_replacer.php +++ b/program/include/rcube_string_replacer.php @@ -23,7 +23,8 @@ /** * Helper class for string replacements based on preg_replace_callback * - * @package Core + * @package Framework + * @subpackage Utils */ class rcube_string_replacer { diff --git a/program/include/rcube_user.php b/program/include/rcube_user.php index 72b03cd15..5a8e9005e 100644 --- a/program/include/rcube_user.php +++ b/program/include/rcube_user.php @@ -5,7 +5,7 @@ | program/include/rcube_user.inc | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2005-2010, The Roundcube Dev Team | + | Copyright (C) 2005-2012, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -17,6 +17,7 @@ | | +-----------------------------------------------------------------------+ | Author: Thomas Bruederli | + | Author: Aleksander Machniak | +-----------------------------------------------------------------------+ */ @@ -24,8 +25,8 @@ /** * Class representing a system user * - * @package Core - * @author Thomas Bruederli + * @package Framework + * @subpackage Core */ class rcube_user { diff --git a/program/include/rcube_utils.php b/program/include/rcube_utils.php index 5cfd8e70e..dfaa9b943 100644 --- a/program/include/rcube_utils.php +++ b/program/include/rcube_utils.php @@ -24,7 +24,8 @@ /** * Utility class providing common functions * - * @package Core + * @package Framework + * @subpackage Utils */ class rcube_utils { diff --git a/program/include/rcube_vcard.php b/program/include/rcube_vcard.php index 51a7fe71a..d0a341da1 100644 --- a/program/include/rcube_vcard.php +++ b/program/include/rcube_vcard.php @@ -5,7 +5,7 @@ | program/include/rcube_vcard.php | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2008-2011, The Roundcube Dev Team | + | Copyright (C) 2008-2012, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -15,6 +15,7 @@ | Logical representation of a vcard address record | +-----------------------------------------------------------------------+ | Author: Thomas Bruederli | + | Author: Aleksander Machniak | +-----------------------------------------------------------------------+ */ @@ -23,8 +24,8 @@ * Logical representation of a vcard-based address record * Provides functions to parse and export vCard data format * - * @package Addressbook - * @author Thomas Bruederli + * @package Framework + * @subpackage Addressbook */ class rcube_vcard { -- cgit v1.2.3