[Vtigercrm-commits] [vtiger-commits] r6525 - in /vtigercrm/trunk/modules/Webmails: Save.php body.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat May 27 05:44:59 EDT 2006
Author: mmbrich
Date: Sat May 27 03:44:59 2006
New Revision: 6525
Log:
more inline attachments fixes
Modified:
vtigercrm/trunk/modules/Webmails/Save.php
vtigercrm/trunk/modules/Webmails/body.php
Modified: vtigercrm/trunk/modules/Webmails/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/Save.php (original)
+++ vtigercrm/trunk/modules/Webmails/Save.php Sat May 27 03:44:59 2006
@@ -100,10 +100,14 @@
function add_attachment_to_contact($cid,$email) {
// add attachments to contact
global $adb,$current_user;
-
- $attachments=$email->downloadAttachments();
- $upload_filepath = decideFilePath();
- for($i=0,$num_files=count($attachments);$i<$num_files;$i++) {
+ for($j=0;$j<2;$j++) {
+ if($j==0)
+ $attachments=$email->downloadAttachments();
+ else
+ $attachments=$email->inline;
+
+ $upload_filepath = decideFilePath();
+ for($i=0,$num_files=count($attachments);$i<$num_files;$i++) {
$current_id = $adb->getUniqueID("crmentity");
$date_var = date('YmdHis');
@@ -127,6 +131,7 @@
$fp = fopen($upload_filepath.'/'.$filename, "w") or die("Can't open file");
fputs($fp, base64_decode($attachments[$i]["filedata"]));
fclose($fp);
+ }
}
}
Modified: vtigercrm/trunk/modules/Webmails/body.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/body.php (original)
+++ vtigercrm/trunk/modules/Webmails/body.php Sat May 27 03:44:59 2006
@@ -70,7 +70,7 @@
echo nl2br($inline[$i]["filedata"]);
echo "</blockquote>";
} elseif($inline[$i]["subtype"] == "JPEG") {
- echo "<a href='javascript:show_inline(".$i.");'>".$inline[$i]["filename"]."</a><div id='block_".$i."' style='border:1px solid gray;padding:6px;background-color:#FFFFCC;visibility:hidden'>";
+ echo "<a href='javascript:show_inline(".$i.");'>".$inline[$i]["filename"]."</a><div id='block_".$i."' style='border:1px solid gray;padding:6px;background-color:#FFFFCC;visibility:hidden;width:95%'>";
global $root_directory;
$save_path=$root_directory.'/modules/Webmails/tmp';
if(!is_dir($save_path))
@@ -82,7 +82,7 @@
$fp = fopen($save_dir.'/'.$inline[$i]["filename"], "w") or die("Can't open file");
fputs($fp, base64_decode($inline[$i]["filedata"]));
$filename = 'modules/Webmails/tmp/cache/'.$inline[$i]['filename'];
- echo '<img src="'.$filename.'" border="0">';
+ echo '<img src="'.$filename.'" border="0" width="100%">';
echo '</div>';
} else
echo "<br>".($i+1).") <a target='_BLANK' href='index.php?module=Webmails&action=dlAttachments&inline=true&num=".$i."&mailid=".$mailid."'>".$inline[$i]["filename"]."</a>";
More information about the vtigercrm-commits
mailing list