[Vtigercrm-commits] [vtiger-commits] r5021 - /vtigercrm/trunk/modules/Webmails/EditView.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Sat Apr 8 00:25:37 EDT 2006
Author: mmbrich
Date: Fri Apr 7 22:25:36 2006
New Revision: 5021
Log:
Fixed so that requests for a new email will redirect to the Emails module
and become part of the CRM workflow
Modified:
vtigercrm/trunk/modules/Webmails/EditView.php
Modified: vtigercrm/trunk/modules/Webmails/EditView.php
==============================================================================
--- vtigercrm/trunk/modules/Webmails/EditView.php (original)
+++ vtigercrm/trunk/modules/Webmails/EditView.php Fri Apr 7 22:25:36 2006
@@ -6,6 +6,16 @@
require_once('include/utils/utils.php');
require_once('include/FormValidationUtil.php');
require_once("include/fckeditor/fckeditor.php");
+if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
+
+if($_REQUEST["record"] && $_REQUEST["record"] != "") {$mailid=$_REQUEST["record"];} else {$mailid=$_REQUEST["mailid"];}
+
+if($mailid == "") {
+ ?>
+ <script type="text/javascript">window.location = "index.php?module=Emails&action=EditView&return_action=index&return_module=Webmails&parenttab=<?php echo $_REQUEST['parenttab'];?>";</script>
+ <?
+}
+
global $log;
global $app_strings;
@@ -64,11 +74,11 @@
$mail_protocol=$temprow["mail_protocol"];
$ssltype=$temprow["ssltype"];
$sslmeth=$temprow["sslmeth"];
-if($_REQUEST["mailbox"] && $_REQUEST["mailbox"] != "") {$mailbox=$_REQUEST["mailbox"];} else {$mailbox="INBOX";}
+
$mbox = @imap_open("\{$imapServerAddress/$mail_protocol/$ssltype/$sslmeth}$mailbox", $login_username, $secretkey) or die("Connection to server failed");
-
-$webmail = new Webmail($mbox,$_REQUEST["mailid"]);
+
+$webmail = new Webmail($mbox,$mailid);
$webmail->loadMail();
$focus->column_fields['description'] = strip_tags($webmail->body);
$focus->column_fields['subject'] = $webmail->subject;
@@ -80,11 +90,11 @@
}
for($i=0;$i<count($webmail->cc_list);$i++) {
$cc .= $webmail->cc_list[$i].";";
-}
+}
for($i=0;$i<count($webmail->bcc_list);$i++) {
$bcc .= $webmail->bcc_list[$i].";";
-}
-
+}
+
$body = "<br /><br /><br /><br /><strong>In reply to the message sent by ";
$body .= $webmail->fromname." < ".$webmail->from." > on ".$webmail->date.": </strong><br />";
$body .= "<blockquote type='cite'>".$webmail->body."</blockquote>";
@@ -107,6 +117,7 @@
$block["Email Information"][1][] = array(array(21),array("CC:"),array("cc_list"),array($cc));
$block["Email Information"][3][] = array(array(1),array("Subject:"),array("subject"),array($webmail->subject));
+
$block["Email Information"][3][] = array(array(1),array("BCC:"),array("bcc_list"),array($bcc));
$block["Email Information"][4][] = array(array(19),array("Body :"),array("email_body"),array($body));
More information about the vtigercrm-commits
mailing list