Skip to content

Commit

Permalink
[mms] Add bare address information to title attribute in viewport on …
Browse files Browse the repository at this point in the history
…dynamic mailbox page
  • Loading branch information
slusarz committed Apr 2, 2014
1 parent 39580f4 commit 0d66b65
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
2 changes: 2 additions & 0 deletions imp/docs/CHANGES
Expand Up @@ -2,6 +2,8 @@
v6.2.0-git
----------

[mms] Add bare address information to title attribute in viewport on dynamic
mailbox page
[mms] Display flags on the smartmobile mailbox page (Request #12687).
[mms] Support non-ASCII characters in user-defined flag names (Request #12335).
[mms] Potentially save a call to the contacts backend when viewing HTML
Expand Down
12 changes: 8 additions & 4 deletions imp/js/dimpbase.js
Expand Up @@ -506,10 +506,14 @@ var DimpBase = {
break;
}
} else if (!Object.isUndefined(r[h])) {
if (h == 'subject') {
/* This is an attribute, so we need to escape
* quotes only. */
r.subjecttitle = r[h].escapeHTML().gsub('"', '"');
switch (h) {
case 'from':
r.fromtitle = escapeAttr(r.fromaddr || r.from);
break;

case 'subject':
r.subjecttitle = escapeAttr(r[h]);
break;
}

r[h] = r[h].escapeHTML();
Expand Down
3 changes: 3 additions & 0 deletions imp/lib/Ajax/Application/ListMessages.php
Expand Up @@ -455,6 +455,9 @@ private function _getOverviewData($mbox, $msglist)
/* Format the From: Header. */
$getfrom = $imp_ui->getFrom($ob['envelope']);
$msg['from'] = $getfrom['from'];
if ($getfrom['from'] !== $getfrom['from_addr']) {
$msg['fromaddr'] = $getfrom['from_addr'];
}

/* Format the Subject: Header. */
$msg['subject'] = $imp_ui->getSubject($ob['envelope']->subject);
Expand Down
8 changes: 6 additions & 2 deletions imp/lib/Mailbox/Ui.php
Expand Up @@ -55,7 +55,9 @@ public function __construct($mailbox = null)
* @param Horde_Imap_Client_Data_Envelope $ob An envelope object.
*
* @return array An array of information:
* - from: (string) The personal part(s) of the From address.
* - from: (string) The label(s) of the From address (personal part;
* fallback to address).
* - from_addr: (string) The bare address(es) of the From address.
* - from_list: (Horde_Mail_Rfc822_List) From address list.
* - to: (boolean) True if this is who the message was sent to.
*/
Expand Down Expand Up @@ -95,14 +97,16 @@ public function getFrom($ob)
}
}

$parts = array();
$bare = $parts = array();

$addrs->unique();
foreach ($addrs->base_addresses as $val) {
$bare[] = $val->bare_address;
$parts[] = $val->label;
}

$ret['from'] .= implode(', ', $parts);
$ret['from_addr'] = implode(', ', $bare);
$ret['from_list'] = $addrs;

return $ret;
Expand Down
1 change: 1 addition & 0 deletions imp/package.xml
Expand Up @@ -33,6 +33,7 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [mms] Add bare address information to title attribute in viewport on dynamic mailbox page
* [mms] Display flags on the smartmobile mailbox page (Request #12687).
* [mms] Support non-ASCII characters in user-defined flag names (Request #12335).
* [mms] Potentially save a call to the contacts backend when viewing HTML messages if no image data is present in the message.
Expand Down
2 changes: 1 addition & 1 deletion imp/templates/dynamic/msglist_horiz.html
Expand Up @@ -3,7 +3,7 @@
<div class="iconImg msCheck"></div>
#{status}
</div>
<div class="msgFrom sep">#{from}</div>
<div class="msgFrom sep" title="#{fromtitle}">#{from}</div>
<div class="msgSubject sep" title="#{subjecttitle}">#{subjectdata}#{subject}</div>
<div class="msgDate sep">#{date}</div>
<div class="msgSize sep">#{size}</div>
Expand Down

0 comments on commit 0d66b65

Please sign in to comment.