diff options
Diffstat (limited to 'program')
| -rw-r--r-- | program/include/iniset.php | 2 | ||||
| -rw-r--r-- | program/include/rcmail_output_html.php | 2 | ||||
| -rw-r--r-- | program/js/app.js | 27 | ||||
| -rw-r--r-- | program/lib/Roundcube/bootstrap.php | 2 | ||||
| -rw-r--r-- | program/lib/Roundcube/rcube_csv2vcard.php | 6 | ||||
| -rw-r--r-- | program/lib/Roundcube/rcube_message.php | 2 | ||||
| -rw-r--r-- | program/localization/en_US/labels.inc | 2 | ||||
| -rw-r--r-- | program/localization/zh_TW/csv2vcard.inc | 99 | ||||
| -rw-r--r-- | program/steps/addressbook/export.inc | 23 | ||||
| -rw-r--r-- | program/steps/mail/show.inc | 2 | 
10 files changed, 153 insertions, 14 deletions
| diff --git a/program/include/iniset.php b/program/include/iniset.php index be71fc084..35b5522fc 100644 --- a/program/include/iniset.php +++ b/program/include/iniset.php @@ -5,7 +5,7 @@   | program/include/iniset.php                                            |   |                                                                       |   | This file is part of the Roundcube Webmail client                     | - | Copyright (C) 2008-2012, The Roundcube Dev Team                       | + | Copyright (C) 2008-2013, The Roundcube Dev Team                       |   |                                                                       |   | Licensed under the GNU General Public License version 3 or            |   | any later version with exceptions for skins & plugins.                | diff --git a/program/include/rcmail_output_html.php b/program/include/rcmail_output_html.php index 76342c245..d4a1654f1 100644 --- a/program/include/rcmail_output_html.php +++ b/program/include/rcmail_output_html.php @@ -462,6 +462,7 @@ class rcmail_output_html extends rcmail_output              if (is_readable($path)) {                  $this->config->set('skin_path', $skin_path);                  $this->base_path = preg_replace('!plugins/\w+/!', '', $skin_path);  // set base_path to core skin directory (not plugin's skin) +                $skin_dir = preg_replace('!^plugins/!', '', $skin_path);                  break;              }              else { @@ -643,6 +644,7 @@ class rcmail_output_html extends rcmail_output      protected function file_callback($matches)      {          $file = $matches[3]; +        $file[0] = preg_replace('!^/this/!', '/', $file[0]);          // correct absolute paths          if ($file[0] == '/') { diff --git a/program/js/app.js b/program/js/app.js index c627983f4..71976096c 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -509,7 +509,7 @@ function rcube_webmail()        return false;      // let the browser handle this click (shift/ctrl usually opens the link in a new window/tab) -    if ((obj && obj.href && String(obj.href).indexOf(location.href) < 0) && rcube_event.get_modifier(event)) { +    if ((obj && obj.href && String(obj.href).indexOf('#') < 0) && rcube_event.get_modifier(event)) {        return true;      } @@ -820,7 +820,7 @@ function rcube_webmail()          var qstring = '_mbox='+urlencode(this.env.mailbox)+'&_uid='+this.env.uid+'&_part='+props.part;          // open attachment in frame if it's of a supported mimetype -        if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, $.map(this.env.mimetypes, function(v,k){ return v })) >= 0) { +        if (this.env.uid && props.mimetype && this.env.mimetypes && $.inArray(props.mimetype, this.env.mimetypes) >= 0) {            if (props.mimetype == 'text/html')              qstring += '&_safe=1';            this.attachment_win = window.open(this.env.comm_path+'&_action=get&'+qstring+'&_frame=1', 'rcubemailattachment'); @@ -1090,6 +1090,12 @@ function rcube_webmail()          }          break; +      case 'export-selected': +        if (this.contact_list.rowcount > 0) { +          this.goto_url('export', { _source: this.env.source, _gid: this.env.group, _cid: this.contact_list.get_selection().join(',') }); +        } +        break; +        case 'upload-photo':          this.upload_contact_photo(props || this.gui_objects.uploadform);          break; @@ -3037,7 +3043,7 @@ function rcube_webmail()        ac_props;      // close compose step in opener -    if (window.opener && opener.rcmail && opener.rcmail.env.action == 'compose') { +    if (window.opener && !window.opener.closed && opener.rcmail && opener.rcmail.env.action == 'compose') {        setTimeout(function(){ opener.history.back(); }, 100);        this.env.opened_extwin = true;      } @@ -3707,9 +3713,10 @@ function rcube_webmail()    {      this.display_message(msg, type); -    if (this.env.extwin && window.opener && opener.rcmail) { +    if (this.env.extwin) {        this.lock_form(this.gui_objects.messageform); -      opener.rcmail.display_message(msg, type); +      if (window.opener && !window.opener.closed && opener.rcmail) +        opener.rcmail.display_message(msg, type);        setTimeout(function(){ window.close() }, 1000);      }      else { @@ -4115,6 +4122,7 @@ function rcube_webmail()      // thend we can enable the group-remove-selected command      this.enable_command('group-remove-selected', this.env.group && list.selection.length > 0);      this.enable_command('compose', this.env.group || list.selection.length > 0); +    this.enable_command('export-selected', list.selection.length > 0);      this.enable_command('edit', id && writable);      this.enable_command('delete', list.selection.length && writable); @@ -4219,12 +4227,10 @@ function rcube_webmail()        target = win;        this.show_contentframe(true); -      // load dummy content -      if (!cid) { -        // unselect selected row(s) +      // load dummy content, unselect selected row(s) +      if (!cid)          this.contact_list.clear_selection(); -        this.enable_command('delete', 'compose', false); -      } +      this.enable_command('delete', 'compose', 'export-selected', cid);      }      else if (framed)        return false; @@ -6238,6 +6244,7 @@ function rcube_webmail()            this.enable_command('compose', (uid && this.contact_list.rows[uid]));            this.enable_command('delete', 'edit', writable);            this.enable_command('export', (this.contact_list && this.contact_list.rowcount > 0)); +          this.enable_command('export-selected', false);          }        case 'moveto': diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 530a7f855..8cea48122 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -3,7 +3,7 @@  /*   +-----------------------------------------------------------------------+   | This file is part of the Roundcube PHP suite                          | - | Copyright (C) 2005-2012, The Roundcube Dev Team                       | + | Copyright (C) 2005-2013, The Roundcube Dev Team                       |   |                                                                       |   | Licensed under the GNU General Public License version 3 or            |   | any later version with exceptions for skins & plugins.                | diff --git a/program/lib/Roundcube/rcube_csv2vcard.php b/program/lib/Roundcube/rcube_csv2vcard.php index e8202c6d4..0d3276b84 100644 --- a/program/lib/Roundcube/rcube_csv2vcard.php +++ b/program/lib/Roundcube/rcube_csv2vcard.php @@ -124,6 +124,12 @@ class rcube_csv2vcard          //'work_address_2'        => '',          'work_country'          => 'country:work',          'work_zipcode'          => 'zipcode:work', +        'last'                  => 'surname', +        'first'                 => 'firstname', +        'work_city'             => 'locality:work', +        'work_state'            => 'region:work', +        'home_city_short'       => 'locality:home', +        'home_state_short'      => 'region:home',      );      /** diff --git a/program/lib/Roundcube/rcube_message.php b/program/lib/Roundcube/rcube_message.php index 51b2242df..b52b79b25 100644 --- a/program/lib/Roundcube/rcube_message.php +++ b/program/lib/Roundcube/rcube_message.php @@ -322,7 +322,7 @@ class rcube_message              // parse headers from message/rfc822 part              if (!isset($structure->headers['subject'])) { -                list($headers, $dump) = explode("\r\n\r\n", $this->get_part_content($structure->mime_id, null, true, 4096)); +                list($headers, $dump) = explode("\r\n\r\n", $this->get_part_content($structure->mime_id, null, true, 8192));                  $structure->headers = rcube_mime::parse_headers($headers);              }          } diff --git a/program/localization/en_US/labels.inc b/program/localization/en_US/labels.inc index 9deaa6677..a0b6e6a31 100644 --- a/program/localization/en_US/labels.inc +++ b/program/localization/en_US/labels.inc @@ -335,6 +335,8 @@ $labels['composeto']      = 'Compose mail to';  $labels['contactsfromto'] = 'Contacts $from to $to of $count';  $labels['print']          = 'Print';  $labels['export']         = 'Export'; +$labels['exportall']      = 'Export all'; +$labels['exportsel']      = 'Export selected';  $labels['exportvcards']   = 'Export contacts in vCard format';  $labels['newcontactgroup'] = 'Create new contact group';  $labels['grouprename']    = 'Rename group'; diff --git a/program/localization/zh_TW/csv2vcard.inc b/program/localization/zh_TW/csv2vcard.inc new file mode 100644 index 000000000..9fcacc818 --- /dev/null +++ b/program/localization/zh_TW/csv2vcard.inc @@ -0,0 +1,99 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | localization/zh_TW/csv2vcard.inc                                      | + |                                                                       | + | Localization file of the Roundcube Webmail client                     | + | 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.                | + | See the README file for a full license statement.                     | + |                                                                       | + +-----------------------------------------------------------------------+ + | Author: Aleksander Machniak <alec@alec.pl>                            | + +-----------------------------------------------------------------------+ +*/ + +// This is a list of CSV column names specified in CSV file header +// These must be original texts used in Outlook/Thunderbird exported csv files +// Encoding UTF-8 + +$map = array(); + +// MS Outlook 2010 +$map['anniversary'] = "紀念日"; +$map['assistants_name'] = "助理"; +$map['assistants_phone'] = "助理電話"; +$map['birthday'] = "生日"; +$map['business_city'] = "商務 - 市/鎮"; +$map['business_countryregion'] = "商務 - 國家/地區"; +$map['business_fax'] = "商務傳真"; +$map['business_phone'] = "商務電話"; +$map['business_phone_2'] = "商務電話 2"; +$map['business_postal_code'] = "商務 - 郵遞區號"; +$map['business_state'] = "商務 - 縣市"; +$map['business_street'] = "商務 - 街"; +$map['car_phone'] = "汽車電話"; +$map['categories'] = "類別"; +$map['company'] = "公司"; +$map['department'] = "部門"; +$map['email_address'] = "電子郵件地址"; +$map['first_name'] = "名字"; +$map['gender'] = "性別"; +$map['home_city'] = "住家 - 市/鎮"; +$map['home_countryregion'] = "住家 - 國家/地區"; +$map['home_fax'] = "住家傳真"; +$map['home_phone'] = "住家電話"; +$map['home_phone_2'] = "住家電話 2"; +$map['home_postal_code'] = "住家 - 郵遞區號"; +$map['home_state'] = "住家 - 縣/市"; +$map['home_street'] = "住家 - 街"; +$map['job_title'] = "職稱"; +$map['last_name'] = "姓氏"; +$map['managers_name'] = "主管名稱"; +$map['middle_name'] = "中間名"; +$map['mobile_phone'] = "行動電話"; +$map['notes'] = "記事"; +$map['other_city'] = "其他 - 市/鎮"; +$map['other_countryregion'] = "其他 - 國家/地區"; +$map['other_fax'] = "其他傳真"; +$map['other_phone'] = "其他電話"; +$map['other_postal_code'] = "其他 - 郵遞區號"; +$map['other_state'] = "其他 - 縣/市"; +$map['other_street'] = "其他 - 街"; +$map['pager'] = "呼叫器"; +$map['primary_phone'] = "代表電話"; +$map['spouse'] = "配偶"; +$map['suffix'] = "稱謂"; +$map['title'] = "頭銜"; +$map['web_page'] = "網頁"; + +// Thunderbird +$map['last'] = "姓"; +$map['first'] = "名"; +$map['birth_day'] = "生日 (日)"; +$map['birth_month'] = "生日 (月)"; +$map['birth_year'] = "生日 (年)"; +$map['display_name'] = "顯示名稱"; +$map['fax_number'] = "傳真號碼"; +$map['home_address'] = "住家住址"; +$map['home_country'] = "居住國家"; +$map['home_zipcode'] = "住址郵遞區號"; +$map['mobile_number'] = "手機號碼"; +$map['nickname'] = "暱稱"; +$map['organization'] = "Organization"; +$map['pager_number'] = "呼叫器號碼"; +$map['primary_email'] = "主要 Email"; +$map['secondary_email'] = "次要 Email"; +$map['web_page_1'] = "網頁 1"; +$map['web_page_2'] = "網頁 2"; +$map['work_phone'] = "商務電話"; +$map['work_address'] = "商務地址"; +$map['work_country'] = "商務國家"; +$map['work_zipcode'] = "商務郵遞區號"; +$map['work_city'] = "商務市鎮"; +$map['work_state'] = "商務縣市"; +$map['home_city_short'] = "居住市鎮"; +$map['home_state_short'] = "居住縣市"; diff --git a/program/steps/addressbook/export.inc b/program/steps/addressbook/export.inc index 850795c85..bf0657b74 100644 --- a/program/steps/addressbook/export.inc +++ b/program/steps/addressbook/export.inc @@ -56,6 +56,29 @@ if (!empty($_REQUEST['_search']) && isset($_SESSION['search'][$_REQUEST['_search      $result = new rcube_result_set($count);      $result->records = array_values($records);  } +// selected contacts +else if (!empty($_REQUEST['_cid'])) { +    $sort_col = $RCMAIL->config->get('addressbook_sort_col', 'name'); +    $records = array(); + +    $cids = explode(',', get_input_value('_cid', RCUBE_INPUT_GET)); +    $CONTACTS = rcmail_contact_source(null, true); + +    // Get records from all sources +    foreach ($cids as $cid) { +        $record = $CONTACTS->get_record($cid, true); +        $key = rcmail_contact_key($record, $sort_col); +        $records[$key] = $record; +        unset($record); +    } + +    ksort($records, SORT_LOCALE_STRING); + +    // create resultset object +    $count  = count($records); +    $result = new rcube_result_set($count); +    $result->records = array_values($records); +}  // selected directory/group  else {      $CONTACTS = rcmail_contact_source(null, true); diff --git a/program/steps/mail/show.inc b/program/steps/mail/show.inc index 64e628880..3495df9c0 100644 --- a/program/steps/mail/show.inc +++ b/program/steps/mail/show.inc @@ -79,7 +79,7 @@ if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) {      }    } -  $OUTPUT->set_env('mimetypes', $mimetypes); +  $OUTPUT->set_env('mimetypes', array_values($mimetypes));    if ($CONFIG['drafts_mbox'])      $OUTPUT->set_env('drafts_mailbox', $CONFIG['drafts_mbox']); | 
