[Vtigercrm-commits] [vtiger-commits] r10187 - in /vtigercrm/branches/5.0.3: include/js/general.js modules/Emails/EditView.php soap/thunderbirdplugin.php soap/vtigerolservice.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Feb 15 08:09:42 EST 2007
Author: saraj
Date: Thu Feb 15 06:09:24 2007
New Revision: 10187
Log:
>From email id added in vtiger from plugins
Modified:
vtigercrm/branches/5.0.3/include/js/general.js
vtigercrm/branches/5.0.3/modules/Emails/EditView.php
vtigercrm/branches/5.0.3/soap/thunderbirdplugin.php
vtigercrm/branches/5.0.3/soap/vtigerolservice.php
Modified: vtigercrm/branches/5.0.3/include/js/general.js
==============================================================================
--- vtigercrm/branches/5.0.3/include/js/general.js (original)
+++ vtigercrm/branches/5.0.3/include/js/general.js Thu Feb 15 06:09:24 2007
@@ -713,7 +713,7 @@
if(gVTModule == 'Contacts' && gValidationCall != 'tabchange')
{
if(getObj('portal').checked && trim(getObj('email').value) == '') {
- alert("Portal user should provide email address for portal login");
+ alert("Portal user should provide email Id for portal login");
return false;
}
}
@@ -1549,7 +1549,12 @@
function fnHide_Event(obj){
document.getElementById(obj).style.visibility = 'hidden';
}
-
+function ReplyCompose(id,mode)
+{
+ url = 'index.php?module=Emails&action=EmailsAjax&file=EditView&record='+id+'&reply=true';
+
+ openPopUp('xComposeEmail',this,url,'createemailWin',820,689,'menubar=no,toolbar=no,location=no,status=no,resizable=no,scrollbars=yes');
+}
function OpenCompose(id,mode)
{
switch(mode)
Modified: vtigercrm/branches/5.0.3/modules/Emails/EditView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/EditView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/EditView.php Thu Feb 15 06:09:24 2007
@@ -49,7 +49,6 @@
echo parseEmailErrorString($_REQUEST['mail_error']);
}
-
if(isset($_REQUEST['record']) && $_REQUEST['record'] !='')
{
$focus->id = $_REQUEST['record'];
@@ -58,7 +57,8 @@
if(isset($_REQUEST['forward']) && $_REQUEST['forward'] != '')
{
$focus->mode = '';
- }else
+ }
+ else
{
$query = 'select idlists,from_email,to_email,cc_email,bcc_email from vtiger_emaildetails where emailid ='.$focus->id;
$result = $adb->query($query);
@@ -106,6 +106,21 @@
$smarty->assign('BCC_MAIL',$current_user->email1);
}
+//handled for replying emails
+if($_REQUEST['reply'] == "true")
+{
+ $fromadd = $_REQUEST['record'];
+ $query = "select from_email,idlists,cc_email,bcc_email from vtiger_emaildetails where emailid =$fromadd";
+ $result = $adb->query($query);
+ $from_mail = $adb->query_result($result,0,'from_email');
+ $smarty->assign('TO_MAIL',$from_mail.';');
+ $smarty->assign('CC_MAIL',ereg_replace('###',',',$adb->query_result($result,0,'cc_email')));
+ $smarty->assign('BCC_MAIL',ereg_replace('###',',',$adb->query_result($result,0,'bcc_email')));
+ $smarty->assign('IDLISTS',ereg_replace('###',',',$adb->query_result($result,0,'idlists')));
+}
+
+
+
// Webmails
if(isset($_REQUEST["mailid"]) && $_REQUEST["mailid"] != "") {
$mailid = $_REQUEST["mailid"];
@@ -136,7 +151,7 @@
else
$smarty->assign('SUBJECT',"RE: ".$webmail->subject);
- } elseif($_REQUEST["reply"] == "single") {
+ } elseif($_REQUEST["reply"] == "single"){
$smarty->assign('TO_MAIL',$webmail->reply_to[0]);
$smarty->assign('BCC_MAIL',$webmail->to[0]);
if(preg_match("/RE:/i", $webmail->subject))
@@ -144,14 +159,14 @@
else
$smarty->assign('SUBJECT',"RE: ".$webmail->subject);
- } elseif($_REQUEST["forward"] == "true") {
- $smarty->assign('TO_MAIL',$webmail->reply_to[0]);
+ } elseif($_REQUEST["forward"] == "true" ) {
+ $smarty->assign('TO_MAIL',$webmail->from[0]);
$smarty->assign('BCC_MAIL',$webmail->to[0]);
if(preg_match("/FW:/i", $webmail->subject))
$smarty->assign('SUBJECT',$webmail->subject);
else
$smarty->assign('SUBJECT',"FW: ".$webmail->subject);
- }
+ }
$smarty->assign('DESCRIPTION',$webmail->replyBody());
$focus->mode='';
}
Modified: vtigercrm/branches/5.0.3/soap/thunderbirdplugin.php
==============================================================================
--- vtigercrm/branches/5.0.3/soap/thunderbirdplugin.php (original)
+++ vtigercrm/branches/5.0.3/soap/thunderbirdplugin.php Thu Feb 15 06:09:24 2007
@@ -211,6 +211,9 @@
$current_user = new Users();
$user_id = $current_user->retrieve_user_id($user_name);
+ $query = "select email1 from vtiger_users where id =".$user_id;
+ $result = $adb->query($query);
+ $user_emailid = $adb->query_result($result,0,"email1");
$current_user = $current_user->retrieveCurrentUserInfoFromFile($user_id);
$email = new Emails();
//$log->debug($msgdtls['contactid']);
@@ -225,6 +228,9 @@
$email->column_fields[activitytype] = 'Emails';
$email->plugin_save = true;
$email->save("Emails");
+ $query = "select fieldid from vtiger_field where fieldname = 'email' and tabid = 4";
+ $result = $adb->query($query);
+ $field_id = $adb->query_result($result,0,"fieldid");
$email->set_emails_contact_invitee_relationship($email->id,$contact_ids);
$email->set_emails_se_invitee_relationship($email->id,$contact_ids);
$email->set_emails_user_invitee_relationship($email->id,$user_id);
@@ -234,7 +240,7 @@
if(isset($camodulerow))
{
$emailid = $camodulerow["email"];
- $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contact_ids."@77|".'","THUNDERBIRD")';
+ $query = 'insert into vtiger_emaildetails values ('.$email->id.',"'.$emailid.'","'.$user_emailid.'","","","","'.$user_id.'@-1|'.$contact_ids.'@'.$field_id.'|","THUNDERBIRD")';
$adb->query($query);
}
return $email->id;
Modified: vtigercrm/branches/5.0.3/soap/vtigerolservice.php
==============================================================================
--- vtigercrm/branches/5.0.3/soap/vtigerolservice.php (original)
+++ vtigercrm/branches/5.0.3/soap/vtigerolservice.php Thu Feb 15 06:09:24 2007
@@ -314,6 +314,9 @@
$current_user = new Users();
$user_id = $current_user->retrieve_user_id($username);
+ $query = "select email1 from vtiger_users where id =".$user_id;
+ $result = $adb->query($query);
+ $user_emailid = $adb->query_result($result,0,"email1");
$current_user = $current_user->retrieveCurrentUserInfoFromFile($user_id);
foreach($msgdtls as $msgdtl)
@@ -333,17 +336,19 @@
$email->column_fields[activitytype] = 'Emails';
$email->plugin_save = true;
$email->save("Emails");
-
+ $query = "select fieldid from vtiger_field where fieldname = 'email' and tabid = 4";
+ $result = $adb->query($query);
+ $field_id = $adb->query_result($result,0,"fieldid");
$email->set_emails_contact_invitee_relationship($email->id,$contactid);
$email->set_emails_se_invitee_relationship($email->id,$contactid);
- $email->set_emails_user_invitee_relationship($email->id,$user_id);
+ $email->set_emails_user_invitee_relationship($email->id,$user_id);
$sql = "select email from vtiger_contactdetails inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid where vtiger_crmentity.deleted =0 and vtiger_contactdetails.contactid='".$contactid."'";
$result = $adb->query($sql);
$camodulerow = $adb->fetch_array($result);
if(isset($camodulerow))
{
$emailid = $camodulerow["email"];
- $query = 'insert into vtiger_emaildetails values ('.$email->id.',"","'.$emailid.'","","","","'.$contactid."@77|".'","OUTLOOK")';
+ $query = 'insert into vtiger_emaildetails values ('.$email->id.',"'.$emailid.'","'.$user_emailid.'","","","","'.$user_id.'@-1|'.$contactid.'@'.$field_id.'|","OUTLOOK")';
$adb->query($query);
}
return $email->id;
More information about the vtigercrm-commits
mailing list