[Vtigercrm-commits] [vtiger-commits] r11065 - in /vtigercrm/branches/5.0.3/modules: Emails/EditView.php Emails/mailsend.php Vendors/DetailView.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Sat May 26 11:47:00 EDT 2007


Author: richie
Date: Sat May 26 09:46:54 2007
New Revision: 11065

Log:
fxed the issues - fatal error in compose pop up from vendor list view and mail not sending from user listview -Sri

Modified:
    vtigercrm/branches/5.0.3/modules/Emails/EditView.php
    vtigercrm/branches/5.0.3/modules/Emails/mailsend.php
    vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php

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 Sat May 26 09:46:54 2007
@@ -113,6 +113,8 @@
 			$q = "select email as email1 from vtiger_contactdetails where contactid='".$rec_id."'";
 		elseif ($type == "Accounts")
 			$q = "select email1,email2 from vtiger_account where accountid='".$rec_id."'";
+		elseif ($type == "Vendors")
+			$q = "select email as email1 from vtiger_vendor where vendorid='".$rec_id."'";
 		$email1 = $adb->query_result($adb->query($q),0,"email1");
 	} elseif ($rec_type == "email_addy") {
 		$email1 = $_REQUEST["email_addy"];
@@ -168,7 +170,7 @@
 		$smarty->assign('TO_MAIL',$webmail->from);	
 		//added to remove the emailid of webmail client from cc list....to fix the issue #3818
                 $cc_address = '';
-                $cc_array = explode(',',$hdr->ccaddress);
+                $cc_array = explode(',',$webmail->to[0].','.$hdr->ccaddress);
                 for($i=0;$i<count($cc_array);$i++) {
                         if(trim($cc_array[$i]) != trim($temp_id)) {
                                 $cc_address .= $cc_array[$i];

Modified: vtigercrm/branches/5.0.3/modules/Emails/mailsend.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Emails/mailsend.php (original)
+++ vtigercrm/branches/5.0.3/modules/Emails/mailsend.php Sat May 26 09:46:54 2007
@@ -105,6 +105,18 @@
 	$realid=explode("@",$myids[$i]);
 	$nemail=count($realid);
 	$mycrmid=$realid[0];
+	if($realid[1] == -1)
+        {
+                //handle the mail send to vtiger_users
+                $emailadd = $adb->query_result($adb->query("select email1 from vtiger_users where id=$mycrmid"),0,'email1');
+                $pmodule = 'Users';
+                $description = getMergedDescription($focus->column_fields['description'],$mycrmid,$pmodule);
+                $mail_status = send_mail('Emails',$emailadd,$current_user->user_name,'',$focus->column_fields['subject'],$description,'','','all',$focus->id);
+                $all_to_emailids []= $emailadd;
+                $mail_status_str .= $emailadd."=".$mail_status."&&&";
+        }
+        else
+        {
 		//Send mail to vtiger_account or lead or contact based on their ids
 		$pmodule=getSalesEntityType($mycrmid);
 		for ($j=1;$j<$nemail;$j++)
@@ -130,6 +142,12 @@
 				$myfocus = new Leads();
 				$myfocus->retrieve_entity_info($mycrmid,"Leads");
 			}
+			elseif ($pmodule=='Vendors')
+                        {
+                                require_once('modules/Vendors/Vendors.php');
+                                $myfocus = new Vendors();
+                                $myfocus->retrieve_entity_info($mycrmid,"Vendors");
+                        }
 			$fldname=$adb->query_result($fresult,0,"columnname");
 			$emailadd=br2nl($myfocus->column_fields[$fldname]);
 
@@ -152,7 +170,8 @@
 					$errorheader2 = 1;
 				}
 			}
-		}	
+		}
+	}	
 
 }
 //Added to redirect the page to Emails/EditView if there is an error in mail sending

Modified: vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php (original)
+++ vtigercrm/branches/5.0.3/modules/Vendors/DetailView.php Sat May 26 09:46:54 2007
@@ -78,6 +78,11 @@
 	$related_array = getRelatedLists($currentModule,$focus);
 	$smarty->assign("RELATEDLISTS", $related_array);
 }
+//added for email link in detailv view
+$querystr="SELECT fieldid FROM vtiger_field WHERE tabid=".getTabid($currentModule)." and uitype=13;";
+$queryres = $adb->query($querystr);
+$fieldid = $adb->query_result($queryres,0,'fieldid');
+$smarty->assign("FIELD_ID",$fieldid);
 
 $smarty->assign("SinglePane_View", $singlepane_view);
 





More information about the vtigercrm-commits mailing list