[Vtigercrm-commits] [vtiger-commits] r10184 - in /vtigercrm/branches/5.0.3/modules: Contacts/Contacts.php Contacts/updateRelations.php Potentials/Save.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Feb 14 09:38:57 EST 2007
Author: saraj
Date: Wed Feb 14 07:38:51 2007
New Revision: 10184
Log:
Improper listing of Potentials in Contact Related list.
Modified:
vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php
vtigercrm/branches/5.0.3/modules/Contacts/updateRelations.php
vtigercrm/branches/5.0.3/modules/Potentials/Save.php
Modified: vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/Contacts.php Wed Feb 14 07:38:51 2007
@@ -349,7 +349,8 @@
$log->info("Potential Related List for Contact Displayed");
// First, get the list of IDs.
- $query = 'select case when (vtiger_users.user_name not like "") then vtiger_users.user_name else vtiger_groups.groupname end as user_name,vtiger_contactdetails.accountid, vtiger_contactdetails.contactid , vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_contactdetails inner join vtiger_potential on vtiger_contactdetails.accountid = vtiger_potential.accountid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid left join vtiger_potentialgrouprelation on vtiger_potential.potentialid=vtiger_potentialgrouprelation.potentialid left join vtiger_groups on vtiger_groups.groupname=vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_contactdetails.contactid = '.$id.' and vtiger_crmentity.deleted=0';
+ $query ='select case when (vtiger_users.user_name not like "") then vtiger_users.user_name else vtiger_groups.groupname end as user_name,vtiger_contactdetails.accountid, vtiger_contactdetails.contactid , vtiger_potential.potentialid, vtiger_potential.potentialname, vtiger_potential.potentialtype, vtiger_potential.sales_stage, vtiger_potential.amount, vtiger_potential.closingdate, vtiger_crmentity.crmid, vtiger_crmentity.smownerid from vtiger_contactdetails inner join vtiger_contpotentialrel on vtiger_contpotentialrel.contactid=vtiger_contactdetails.contactid left join vtiger_potential on vtiger_potential.potentialid = vtiger_contpotentialrel.potentialid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_potential.potentialid left join vtiger_potentialgrouprelation on vtiger_potential.potentialid=vtiger_potentialgrouprelation.potentialid left join vtiger_groups on vtiger_groups.groupname=vtiger_potentialgrouprelation.groupname left join vtiger_users on vtiger_users.id=vtiger_crmentity.smownerid where vtiger_contactdetails.contactid ='.$id.' and vtiger_contactdetails.accountid = vtiger_potential.accountid and vtiger_crmentity.deleted=0';
+
if($this->column_fields['account_id'] != 0)
$log->debug("Exiting get_opportunities method ...");
return GetRelatedList('Contacts','Potentials',$focus,$query,$button,$returnset);
Modified: vtigercrm/branches/5.0.3/modules/Contacts/updateRelations.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Contacts/updateRelations.php (original)
+++ vtigercrm/branches/5.0.3/modules/Contacts/updateRelations.php Wed Feb 14 07:38:51 2007
@@ -8,13 +8,13 @@
* All Rights Reserved.
*
********************************************************************************/
-
require_once('include/database/PearDatabase.php');
require_once('user_privileges/default_module_view.php');
global $adb, $singlepane_view;
$idlist = $_REQUEST['idlist'];
$dest_mod = $_REQUEST['destination_module'];
$rel_table = 'vtiger_campaigncontrel';
+$record = $_REQUEST['record'];
if($singlepane_view == 'true')
$action = "DetailView";
@@ -53,6 +53,12 @@
$adb->query($sql);
$record = $_REQUEST["parid"];
}
+elseif(isset($_REQUEST['pot_id']) && $_REQUEST['pot_id'] != '')
+{
+ $sql = "insert into vtiger_contpotentialrel values(".$record.",".$_REQUEST["pot_id"].")";
+ $adb->query($sql);
+}
+
$module = 'Contacts';
if($_REQUEST['return_module'] != '') $module = $_REQUEST['return_module'];
Modified: vtigercrm/branches/5.0.3/modules/Potentials/Save.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Potentials/Save.php (original)
+++ vtigercrm/branches/5.0.3/modules/Potentials/Save.php Wed Feb 14 07:38:51 2007
@@ -42,7 +42,7 @@
}
$focus->save("Potentials");
-$return_id = $focus->id;
+$pot_id = $return_id = $focus->id;
if(isset($_REQUEST['parenttab']) && $_REQUEST['parenttab'] != "") $parenttab = $_REQUEST['parenttab'];
if(isset($_REQUEST['return_module']) && $_REQUEST['return_module'] != "") $return_module = $_REQUEST['return_module'];
@@ -60,6 +60,6 @@
//Added to send mail to the vtiger_potential-owner about the Potential
$status = sendNotificationToOwner('Potentials',&$focus);
-header("Location: index.php?action=$return_action&module=$return_module&parenttab=$parenttab&record=$return_id&viewname=$return_viewname");
+header("Location: index.php?action=$return_action&module=$return_module&parenttab=$parenttab&record=$return_id&pot_id=$pot_id&viewname=$return_viewname");
?>
More information about the vtigercrm-commits
mailing list