[Vtigercrm-commits] [vtiger-commits] r9597 - /vtigercrm/branches/5.0.1/modules/Notes/Save.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Mon Oct 9 03:17:09 EDT 2006
Author: richie
Date: Mon Oct 9 01:17:06 2006
New Revision: 9597
Log:
code given by DG has been integrated -- Minnie
Modified:
vtigercrm/branches/5.0.1/modules/Notes/Save.php
Modified: vtigercrm/branches/5.0.1/modules/Notes/Save.php
==============================================================================
--- vtigercrm/branches/5.0.1/modules/Notes/Save.php (original)
+++ vtigercrm/branches/5.0.1/modules/Notes/Save.php Mon Oct 9 01:17:06 2006
@@ -85,6 +85,30 @@
else $return_action = "DetailView";
if(isset($_REQUEST['return_id']) && $_REQUEST['return_id'] != "") $return_id = $_REQUEST['return_id'];
+// Notes added to Contacts should also update Accounts
+// Added by DG 16 Nov 2005
+if($_REQUEST['mode'] != 'edit' && ($_REQUEST['return_module']=='Contacts'))
+{
+ $crmid = $_REQUEST['return_id'];
+ $noteid = $focus->id;
+ $query = 'select accountid from vtiger_contactdetails where contactid='.$crmid;
+ $result = $adb->query($query);
+ if($adb->num_rows($result) != 0)
+ {
+ $associated_account = $adb->query_result($result,0,"accountid");
+ }
+ else
+ {
+ $associated_account = '';
+ }
+ if ($associated_account)
+ {
+ $sql1 = "insert into vtiger_senotesrel (notesid, crmid) values('";
+ $sql1 .= $noteid."','".$associated_account."')";
+ $result = $adb->query($sql1);
+ }
+}
+
if($_REQUEST['mode'] != 'edit' && (($_REQUEST['return_module']=='Emails') ||($_REQUEST['return_module']=='HelpDesk') ))
{
if($_REQUEST['email_id'] != '')
More information about the vtigercrm-commits
mailing list