[imp] Patch for viewing sent-mail folder

mcaplin at miami.edu mcaplin at miami.edu
Thu Jun 3 10:32:44 PDT 2004


One of my users asked that, only in his "sent mail" folder, the To address 
is displayed instead of the From address.  I created patches (against 
imp-3.2.3) for this and have attached them.  The 2 patched files are 
mailbox.php and templates/mailbox/message_headers.inc.

michael caplin
_______________________________________________________________________________
mcaplin at miami.edu
-------------- next part --------------
--- mailbox.php.orig	2004-06-01 16:00:04.000000000 -0400
+++ mailbox.php	2004-06-03 11:29:26.000000000 -0400
@@ -684,7 +684,10 @@
     }
 
     if (isset($h->from)) {
-        $tmp = imap_rfc822_parse_adrlist($h->from, '');
+        if ($imp['label'] == $prefs->getValue('sent_mail_folder')) 
+           $tmp = imap_rfc822_parse_adrlist($h->to, '');
+        else
+           $tmp = imap_rfc822_parse_adrlist($h->from, '');
         $tmp = $tmp[0];
         $fullfrom = '';
 
-------------- next part --------------
--- message_headers.inc.orig	2004-06-01 16:00:05.000000000 -0400
+++ message_headers.inc	2004-06-03 11:28:59.000000000 -0400
@@ -12,10 +12,17 @@
         <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTDATE . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
         <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTDATE); ?>"><?php echo _("Date") ?></a>
     </th>
+<?php if ($imp['label'] == $prefs->getValue('sent_mail_folder')) { ?>
+    <th class="<?php echo ($prefs->getValue('sortby') == SORTTO) ? 'selected' : 'item' ?>" width="20%" align="left" nowrap="nowrap">
+        <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTTO . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
+        <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTTO); ?>"><?php echo _("To") ?></a>
+    </th>
+<?php } else { ?>
     <th class="<?php echo ($prefs->getValue('sortby') == SORTFROM) ? 'selected' : 'item' ?>" width="20%" align="left" nowrap="nowrap">
         <a href="<?php echo Horde::url('mailbox.php?sortby=' . SORTFROM . '&sortdir=' . abs(1 - $prefs->getValue('sortdir'))); ?>"><?php echo Horde::img($prefs->getValue('sortdir') ? 'down.gif' : 'up.gif', 'alt="' . _("Sort Direction") . '"'); ?></a>
         <a class="widget" href="<?php echo Horde::url('mailbox.php?sortby=' . SORTFROM); ?>"><?php echo _("From") ?></a>
     </th>
+<?php } ?>
     <th nowrap="nowrap" width="2%">&nbsp;</th>
     <th class="<?php echo ($prefs->getValue('sortby') == SORTSUBJECT || $prefs->getValue('sortby') == SORTTHREAD) ? 'selected' : 'item' ?>" width="50%" align="left" nowrap="nowrap">
 <?php if ($prefs->getValue('sortby') == SORTTHREAD): ?>


More information about the imp mailing list