Changeset 6087 in subversion
- Timestamp:
- Apr 15, 2012 4:22:07 AM (13 months ago)
- Location:
- branches/release-0.8
- Files:
-
- 5 edited
-
plugins/vcard_attachments/package.xml (modified) (3 diffs)
-
plugins/vcard_attachments/vcard_attachments.php (modified) (5 diffs)
-
plugins/vcard_attachments/vcardattach.js (modified) (1 diff)
-
program/include/rcube_message.php (modified) (2 diffs)
-
skins/larry/mail.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-0.8/plugins/vcard_attachments/package.xml
r5997 r6087 20 20 <active>yes</active> 21 21 </lead> 22 <date>2012-0 3-11</date>23 <time>1 9:00</time>22 <date>2012-04-13</date> 23 <time>12:00</time> 24 24 <version> 25 <release>3.1 -beta</release>26 <api>3.1 -beta</api>25 <release>3.1</release> 26 <api>3.1</api> 27 27 </version> 28 28 <stability> … … 32 32 <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> 33 33 <notes> 34 - Add styles for new skin "Larry" 35 - Exec contact_create hook when adding contact (#1486964) 36 - Make icons skinable 37 - Display vcard icon on messages list when message is of type vcard 34 - Fixed doble urlencoding of vcard identifier 35 - Fixed encoding when default charset is different than vcard charset 36 - Improved vcards import to work as addressbook::import procedure (with validation and autofix) 37 - Support IDNA 38 - Import contacts to default addressbook 38 39 </notes> 39 40 <contents> … … 118 119 </notes> 119 120 </release> 121 <release> 122 <date>2012-03-11</date> 123 <time>19:00</time> 124 <version> 125 <release>3.1-beta</release> 126 <api>3.1-beta</api> 127 </version> 128 <stability> 129 <release>stable</release> 130 <api>stable</api> 131 </stability> 132 <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> 133 <notes> 134 - Add styles for new skin "Larry" 135 - Exec contact_create hook when adding contact (#1486964) 136 - Make icons skinable 137 - Display vcard icon on messages list when message is of type vcard 138 </notes> 139 </release> 120 140 </changelog> 121 141 </package> -
branches/release-0.8/plugins/vcard_attachments/vcard_attachments.php
r5997 r6087 67 67 68 68 foreach ($this->vcard_parts as $part) { 69 $vcards = rcube_vcard::import($this->message->get_part_content($part ));69 $vcards = rcube_vcard::import($this->message->get_part_content($part, null, true)); 70 70 71 71 // successfully parsed vcards? … … 115 115 $mime_id = get_input_value('_part', RCUBE_INPUT_POST); 116 116 117 $rcmail = rcmail::get_instance(); 117 $rcmail = rcmail::get_instance(); 118 $storage = $rcmail->get_storage(); 119 $storage->set_folder($mbox); 118 120 119 121 if ($uid && $mime_id) { 120 122 list($mime_id, $index) = explode(':', $mime_id); 121 $part = $ rcmail->storage->get_message_part($uid, $mime_id);123 $part = $storage->get_message_part($uid, $mime_id, null, null, null, true); 122 124 } 123 125 … … 125 127 126 128 if ($part && ($vcards = rcube_vcard::import($part)) 127 && ($vcard = $vcards[$index]) && $vcard->displayname && $vcard->email) { 128 129 $contacts = $rcmail->get_address_book(null, true); 130 131 // check for existing contacts 132 $existing = $contacts->search('email', $vcard->email[0], true, false); 133 if ($existing->count) { 134 $rcmail->output->command('display_message', $this->gettext('contactexists'), 'warning'); 129 && ($vcard = $vcards[$index]) && $vcard->displayname && $vcard->email 130 ) { 131 $CONTACTS = $this->get_address_book(); 132 $email = $vcard->email[0]; 133 $contact = $vcard->get_assoc(); 134 $valid = true; 135 136 // skip entries without an e-mail address or invalid 137 if (empty($email) || !$CONTACTS->validate($contact, true)) { 138 $valid = false; 135 139 } 136 140 else { 137 // add contact 138 $contact = array( 139 'name' => $vcard->displayname, 140 'firstname' => $vcard->firstname, 141 'surname' => $vcard->surname, 142 'email' => $vcard->email[0], 143 'vcard' => $vcard->export(), 144 ); 145 141 // We're using UTF8 internally 142 $email = rcube_idn_to_utf8($email); 143 144 // compare e-mail address 145 $existing = $CONTACTS->search('email', $email, 1, false); 146 // compare display name 147 if (!$existing->count && $vcard->displayname) { 148 $existing = $CONTACTS->search('name', $vcard->displayname, 1, false); 149 } 150 151 if ($existing->count) { 152 $rcmail->output->command('display_message', $this->gettext('contactexists'), 'warning'); 153 $valid = false; 154 } 155 } 156 157 if ($valid) { 146 158 $plugin = $rcmail->plugins->exec_hook('contact_create', array('record' => $contact, 'source' => null)); 147 159 $contact = $plugin['record']; 148 160 149 if (!$plugin['abort'] && ($done = $contacts->insert($contact)))161 if (!$plugin['abort'] && $CONTACTS->insert($contact)) 150 162 $rcmail->output->command('display_message', $this->gettext('addedsuccessfully'), 'confirmation'); 151 163 else … … 153 165 } 154 166 } 155 else 167 else { 156 168 $rcmail->output->command('display_message', $error_msg, 'error'); 169 } 157 170 158 171 $rcmail->output->send(); … … 183 196 ); 184 197 } 198 199 /** 200 * Getter for default (writable) addressbook 201 */ 202 private function get_address_book() 203 { 204 if ($this->abook) { 205 return $this->abook; 206 } 207 208 $rcmail = rcmail::get_instance(); 209 $abook = $rcmail->config->get('default_addressbook'); 210 211 // Get configured addressbook 212 $CONTACTS = $rcmail->get_address_book($abook, true); 213 214 // Get first writeable addressbook if the configured doesn't exist 215 // This can happen when user deleted the addressbook (e.g. Kolab folder) 216 if ($abook === null || $abook === '' || !is_object($CONTACTS)) { 217 $source = reset($rcmail->get_address_sources(true)); 218 $CONTACTS = $rcmail->get_address_book($source['id'], true); 219 } 220 221 return $this->abook = $CONTACTS; 222 } 185 223 } -
branches/release-0.8/plugins/vcard_attachments/vcardattach.js
r5997 r6087 6 6 { 7 7 var lock = rcmail.set_busy(true, 'loading'); 8 rcmail.http_post('plugin.savevcard', { _uid: rcmail.env.uid, _mbox: urlencode(rcmail.env.mailbox), _part: urlencode(mime_id)}, lock);9 8 rcmail.http_post('plugin.savevcard', { _uid: rcmail.env.uid, _mbox: rcmail.env.mailbox, _part: mime_id }, lock); 9 10 10 return false; 11 11 } -
branches/release-0.8/program/include/rcube_message.php
r5917 r6087 165 165 * Get content of a specific part of this message 166 166 * 167 * @param string $mime_id Part MIME-ID 168 * @param resource $fp File pointer to save the message part 167 * @param string $mime_id Part MIME-ID 168 * @param resource $fp File pointer to save the message part 169 * @param boolean $skip_charset_conv Disables charset conversion 170 * 169 171 * @return string Part content 170 172 */ 171 public function get_part_content($mime_id, $fp =NULL)173 public function get_part_content($mime_id, $fp = null, $skip_charset_conv = false) 172 174 { 173 175 if ($part = $this->mime_parts[$mime_id]) { … … 180 182 } 181 183 // get from IMAP 182 return $this->storage->get_message_part($this->uid, $mime_id, $part, NULL, $fp );184 return $this->storage->get_message_part($this->uid, $mime_id, $part, NULL, $fp, $skip_charset_conv); 183 185 } else 184 186 return null; -
branches/release-0.8/skins/larry/mail.css
r6062 r6087 476 476 477 477 #messagelist tbody tr td.attachment span.attachment { 478 background-position: 0 -99 8px;478 background-position: 0 -996px; 479 479 } 480 480 #messagelist thead tr td.attachment span.attachment { 481 background-position: -24px -99 7px;481 background-position: -24px -996px; 482 482 } 483 483
Note: See TracChangeset
for help on using the changeset viewer.
