[Vtigercrm-commits] [vtiger-commits] r10912 - in /vtigercrm/branches/5.0.3/modules/Webmails: Save.php body.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Mon May 14 09:17:52 EDT 2007


Author: richie
Date: Mon May 14 07:17:46 2007
New Revision: 10912

Log:
* Fixed the issue in showing the qualified mail body content, Fixed #3712

Modified:
    vtigercrm/branches/5.0.3/modules/Webmails/Save.php
    vtigercrm/branches/5.0.3/modules/Webmails/body.php

Modified: vtigercrm/branches/5.0.3/modules/Webmails/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/Save.php Mon May 14 07:17:46 2007
@@ -30,13 +30,18 @@
 if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
 
 $MailBox = new MailBox($mailbox);
+$mail = $MailBox->mbox;
 $email = new Webmails($MailBox->mbox, $_REQUEST["mailid"]);
 $subject = $email->subject;
 $date = $email->date;
 $array_tab = Array();
 $email->loadMail($array_tab);
 $msgData = $email->body;
-
+$content['attachtab'] = $email->attachtab;
+while ($tmp = array_pop($content['attachtab'])){
+	if ((!eregi('ATTACHMENT', $tmp['disposition'])) && $conf->display_text_attach && (eregi('text/plain', $tmp['mime'])))
+		$msgData .= '<hr />'.view_part_detail($mail, $mailid, $tmp['number'], $tmp['transfer'], $tmp['charset'], $charset);
+}
 $focus->column_fields['subject']=$subject;
 $focus->column_fields["activitytype"]="Emails";
 
@@ -108,6 +113,17 @@
 	    }
 	}
 }
+function view_part_detail($mail,$mailid,$part_no, &$transfer, &$msg_charset, &$charset)
+{
+        $text = imap_fetchbody($mail,$mailid,$part_no);
+        if ($transfer == 'BASE64')
+                $str = nl2br(imap_base64($text));
+        elseif($transfer == 'QUOTED-PRINTABLE')
+                $str = nl2br(quoted_printable_decode($text));
+        else
+                $str = nl2br($text);
+        return ($str);
+}
 
 $_REQUEST['parent_id'] = $focus->column_fields['parent_id'];
 $focus->save("Emails");

Modified: vtigercrm/branches/5.0.3/modules/Webmails/body.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/body.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/body.php Mon May 14 07:17:46 2007
@@ -56,12 +56,12 @@
 
                                                 <tr><td align="right"><b><?php echo $mod_strings['LBL_SUBJECT'];?></b></td><td id="webmail_subject"><?php echo $subject;?></td></tr>
 	<tr><td align="right"><b><?php echo $mod_strings['LBL_DATE'];?></b></td><td id="webmail_date"><?php echo $date;?></td>
-        <tr>
+        <?php if(!$_REQUEST['fullview']) {?>
+        <td id="full_view" nowrap><span style="float:right" colspan="2"><a href="javascript:;" onclick="OpenComposer('<?php echo $mailid;?>','full_view')"> Full Email View</a></span></td>
+        <?php } ?>
+	<tr>
 	<?php if($_REQUEST['fullview'] && $email->has_attachments) {?>
 		<td align="right"><b><?php echo $mod_strings['LBL_ATTACHMENT'];?>:</b></td><td id="webmail_attachment"><?php echo $attachment_links;?></td>
-	<?php } ?>
-	<?php if(!$_REQUEST['fullview']) {?>
-	<td>&nbsp;</td> <td id="full_view"><span style="float:right"  colspan="2"><a href="javascript:;" onclick="OpenComposer('<?php echo $mailid;?>','full_view')"> Full Email View</a></span></td>
 	<?php } ?>
 	</tr>
                                                 <tr><td align="right" style="border-bottom:1px solid #666666;" colspan="3">&nbsp;</td></tr>





More information about the vtigercrm-commits mailing list