[Vtigercrm-commits] [vtiger-commits] r6045 - in /vtigercrm/trunk/modules/Emails: DetailView.php ListView.php Save.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue May 16 07:43:51 EDT 2006


Author: richie
Date: Tue May 16 05:43:46 2006
New Revision: 6045

Log:
Qualified mail feature has been integrated

Modified:
    vtigercrm/trunk/modules/Emails/DetailView.php
    vtigercrm/trunk/modules/Emails/ListView.php
    vtigercrm/trunk/modules/Emails/Save.php

Modified: vtigercrm/trunk/modules/Emails/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/DetailView.php (original)
+++ vtigercrm/trunk/modules/Emails/DetailView.php Tue May 16 05:43:46 2006
@@ -42,13 +42,14 @@
 	$focus->retrieve_entity_info($_REQUEST['record'],"Emails");
 	$log->info("Entity info successfully retrieved for DetailView.");
 	$focus->id = $_REQUEST['record'];
-	$query = 'select from_email,to_email,cc_email,bcc_email from emaildetails where emailid ='.$focus->id;
+	$query = 'select email_flag,from_email,to_email,cc_email,bcc_email from emaildetails where emailid ='.$focus->id;
 	$result = $adb->query($query);
-    $smarty->assign('FROM_MAIL',$adb->query_result($result,0,'from_email'));	
+    	$smarty->assign('FROM_MAIL',$adb->query_result($result,0,'from_email'));	
 	$to_email = ereg_replace('###',', ',$adb->query_result($result,0,'to_email'));
-    $smarty->assign('TO_MAIL',$to_email);	
-    $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('TO_MAIL',$to_email);	
+	$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('EMAIL_FLAG',$adb->query_result($result,0,'email_flag'));	
 	if($focus->column_fields['name'] != '')
 	        $focus->name = $focus->column_fields['name'];		
 	else

Modified: vtigercrm/trunk/modules/Emails/ListView.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/ListView.php (original)
+++ vtigercrm/trunk/modules/Emails/ListView.php Tue May 16 05:43:46 2006
@@ -162,7 +162,7 @@
 }
 if($_REQUEST['folderid'] =='2')
 {
-	$list_query .= "AND seactivityrel.crmid in (select contactid from contactdetails)";
+	$list_query .= "AND seactivityrel.crmid in (select contactid from contactdetails) AND emaildetails.email_flag !='WEBMAIL'";
 }
 if($_REQUEST['folderid'] =='3')
 {
@@ -175,6 +175,10 @@
 if($_REQUEST['folderid'] =='5')
 {
 	$list_query .= "AND salesmanactivityrel.smid in (select id from users)";	
+}
+if($_REQUEST['folderid'] =='6')
+{
+	$list_query .= "AND emaildetails.email_flag ='WEBMAIL'";	
 }
 if(isset($order_by) && $order_by != '')
 {

Modified: vtigercrm/trunk/modules/Emails/Save.php
==============================================================================
--- vtigercrm/trunk/modules/Emails/Save.php (original)
+++ vtigercrm/trunk/modules/Emails/Save.php Tue May 16 05:43:46 2006
@@ -63,7 +63,7 @@
 	header("Location: index.php?module=Emails&action=index");
 	exit();
 }
-if(isset($_REQUEST['fromemail']) && $_REQUEST['fromemail'] != null)
+/*if(isset($_REQUEST['fromemail']) && $_REQUEST['fromemail'] != null)
 {
 	//get the list of data from the comma separated array
 	$emailids = explode(",",$_REQUEST['fromemail']);
@@ -119,7 +119,7 @@
 	}
 	header("Location: index.php?action=$return_action&module=$return_module&parent_id=$parent_id&record=$return_id&filename=$filename");
 	return;
-}
+}*/
 
 /**	Function to check whether the contact is exist of not
  *	input  : contact id
@@ -144,7 +144,7 @@
 		return -1;
 	}
 }
-
+//assign the focus values
 $focus->filename = $_REQUEST['file_name'];
 $focus->parent_id = $_REQUEST['parent_id'];
 $focus->parent_type = $_REQUEST['parent_type'];
@@ -152,6 +152,8 @@
 $focus->column_fields["activitytype"]="Emails";
 $focus->column_fields["date_start"]= date('Y-m-d');
 $focus->save("Emails");
+
+//saving the email details in emaildetails table
 $return_id = $focus->id;
 $email_id = $return_id;
 $query = 'select emailid from emaildetails where emailid ='.$email_id;
@@ -165,12 +167,14 @@
 $all_bcc_ids = ereg_replace(",","###",$_REQUEST["bccmail"]);
 if($adb->num_rows($result) > 0)
 {
-	$query = 'update emaildetails set to_email="'.$all_to_ids.'",cc_email="'.$all_cc_ids.'",bcc_email="'.$all_bcc_ids.'",idlists="'.$_REQUEST["parent_id"].'" where emailid = '.$email_id;
+	$query = 'update emaildetails set to_email="'.$all_to_ids.'",cc_email="'.$all_cc_ids.'",bcc_email="'.$all_bcc_ids.'",idlists="'.$_REQUEST["parent_id"].'",email_flag="SAVED" where emailid = '.$email_id;
 }else
 {
 	$query = 'insert into emaildetails values ('.$email_id.',"","'.$all_to_ids.'","'.$all_cc_ids.'","'.$all_bcc_ids.'","","'.$_REQUEST["parent_id"].'","SAVED")';
 }
-$adb->query($query);	
+$adb->query($query);
+
+
 $focus->retrieve_entity_info($return_id,"Emails");
 
 //this is to receive the data from the Select Users button
@@ -193,14 +197,6 @@
 
 $local_log->debug("Saved record with id of ".$return_id);
 
-/*if($file_upload_error)
-{
-        $return_module = 'Emails';
-        $return_action = 'EditView';
-        $return_id = $email_id.'&upload_error=true&return_module='.$_REQUEST['return_module'].'&return_action='.$_REQUEST['return_action'].'&return_id='.$_REQUEST['return_id'];
-	header("Location: index.php?action=$return_action&module=$return_module&parent_id=$parent_id&record=$return_id&filename=$filename");
-}
-else*/
 if( isset($_REQUEST['send_mail']) && $_REQUEST['send_mail'])
 {
 	include("modules/Emails/mailsend.php");





More information about the vtigercrm-commits mailing list