[Vtigercrm-commits] [vtiger-commits] r10575 - in /vtigercrm/branches/5.0.3/modules/Webmails: DetailView.php Webmails.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Fri Apr 6 02:50:02 EDT 2007
Author: richie
Date: Fri Apr 6 00:49:56 2007
New Revision: 10575
Log:
* Changes made for attachment issues, Fixes #3229
Modified:
vtigercrm/branches/5.0.3/modules/Webmails/DetailView.php
vtigercrm/branches/5.0.3/modules/Webmails/Webmails.php
Modified: vtigercrm/branches/5.0.3/modules/Webmails/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/DetailView.php Fri Apr 6 00:49:56 2007
@@ -44,11 +44,14 @@
$webmail->loadMail($array_tab);
echo '<tr><td align="center"><iframe src="index.php?module=Webmails&action=body&mailid='.$mailid.'&mailbox='.$mailbox.'" width="100%" height="450" frameborder="0" style="border:1px solid gray">'.$mod_strings['LBL_NO_IFRAMES_SUPPORTED'].'</iframe></td></tr>';
-
-echo "<tr><td><p style='font-weight:bold'>".$mod_strings['LBL_EMAIL_ATTACHMENTS']."</p></td></tr>";
-
-foreach($webmail->attachments as $key=>$value) {
+if($webmail->has_attachments)
+{
+ //check for attachments
+ echo "<tr><td><p style='font-weight:bold'>".$mod_strings['LBL_EMAIL_ATTACHMENTS']."</p></td></tr>";
+ echo "<tr><td>".$webmail->att_links."</td></tr>";
+}
+/*foreach($webmail->attachments as $key=>$value) {
echo '<tr><td>'.($key+1).') <a href="index.php?module=Webmails&action=dlAttachments&num='.$key.'&mailid='.$mailid.'&mailbox='.$mailbox.'" target="_blank">'.$value["filename"]."</a></td></tr>";
-}
+}*/
echo '</table>';
?>
Modified: vtigercrm/branches/5.0.3/modules/Webmails/Webmails.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Webmails/Webmails.php (original)
+++ vtigercrm/branches/5.0.3/modules/Webmails/Webmails.php Fri Apr 6 00:49:56 2007
@@ -423,8 +423,10 @@
$mime_type = 'multipart';
for ($i = 0; $i < count($this_part->parts); $i++)
{
- if ($part_no != '')
- $part_no = $part_no . '.';
+ if ($part_no != ''){
+ if(!strpos($part_no,'.'))
+ $part_no = $part_no . '.';
+ }
// if it's an alternative, we skip the text part to only keep the HTML part
if ($this_part->subtype == 'ALTERNATIVE')// && $read == true)
$this->GetPart($attach_tab, $this_part->parts[++$i], $part_no . ($i + 1), $display_rfc822);
@@ -648,7 +650,7 @@
{
$mime = str_replace('/', '-', $tmp['mime']);
if ($display_part_no == true)
- $link .= $tmp['number'] . ' ';
+ $link .= $tmp['number']-1 . ' ';
unset($att_name);
$att_name_array = imap_mime_header_decode($tmp['name']);
for ($i=0; $i<count($att_name_array); $i++) {
@@ -769,6 +771,7 @@
array_push($attach_tab, $tmpvar);
}
$link_att = '';
+ $att_links = '';//variable added to display the attachments in full email view
$conf->display_part_no = true;
if ($struct_msg->subtype != 'ALTERNATIVE' && $struct_msg->subtype != 'RELATED')
{
@@ -779,9 +782,11 @@
break;
case 1:
$link_att = '<span id="webmail_cont" style="display:none;"><tr><th class="mailHeaderLabel right">' . $html_att . ':</th><td class="mailHeaderData">' . $this->link_att($mail, $attach_tab, $conf->display_part_no,$ev) . '</td></tr></span>';
+ $this->att_links .= $this->link_att($mail, $attach_tab, $conf->display_part_no,$ev)."</br>";
break;
default:
$link_att = '<span id="webmail_cont" style="display:none;"><tr><th class="mailHeaderLabel right">' . $html_atts . ':</th><td class="mailHeaderData">' . $this->link_att($mail, $attach_tab, $conf->display_part_no,$ev) . '</td></tr></span>';
+ $this->att_links .= $this->link_att($mail, $attach_tab, $conf->display_part_no,$ev)."</br>";
break;
}
}else
More information about the vtigercrm-commits
mailing list