[Vtigercrm-commits] [vtiger-commits] r9096 - in /vtigercrm/trunk/modules/Campaigns: CallRelatedList.php Campaign.php DetailView.php LoadList.php updateRelations.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Thu Aug 24 01:10:36 EDT 2006


Author: richie
Date: Wed Aug 23 23:10:05 2006
New Revision: 9096

Log:
Updated the single pane view feature for detailview in Campaigns Modules -- ahmed

Modified:
    vtigercrm/trunk/modules/Campaigns/CallRelatedList.php
    vtigercrm/trunk/modules/Campaigns/Campaign.php
    vtigercrm/trunk/modules/Campaigns/DetailView.php
    vtigercrm/trunk/modules/Campaigns/LoadList.php
    vtigercrm/trunk/modules/Campaigns/updateRelations.php

Modified: vtigercrm/trunk/modules/Campaigns/CallRelatedList.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/CallRelatedList.php (original)
+++ vtigercrm/trunk/modules/Campaigns/CallRelatedList.php Wed Aug 23 23:10:05 2006
@@ -60,8 +60,7 @@
 $category = getParentTab();
 $smarty->assign("CATEGORY",$category);
 $smarty->assign("UPDATEINFO",updateInfo($focus->id));
-$smarty->assign("id",$focus->id);
-$smarty->assign("ID",$RECORD );
+$smarty->assign("ID",$focus->id);
 $smarty->assign("MODULE",$currentmodule);
 $smarty->assign("SINGLE_MOD",$app_strings['Campaign']);
 $smarty->assign("MOD",$mod_strings);

Modified: vtigercrm/trunk/modules/Campaigns/Campaign.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/Campaign.php (original)
+++ vtigercrm/trunk/modules/Campaigns/Campaign.php Wed Aug 23 23:10:05 2006
@@ -20,6 +20,7 @@
 require_once('include/utils/utils.php');
 require_once('modules/Contacts/Contact.php');
 require_once('modules/Leads/Lead.php');
+require_once('user_privileges/default_module_view.php');
 
 class Campaign extends CRMEntity {
 	var $log;
@@ -115,13 +116,18 @@
 	 */
 	function get_contacts($id)
         {
-		global $log;
+		global $log, $singlepane_view;
 		$log->debug("Entering get_contacts(".$id.") method ...");
                 global $mod_strings;
 
                 $focus = new Contact();
-                $button = '';
-                $returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
+		$button = '';
+
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Campaigns&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
+
 		$query = 'select vtiger_contactdetails.accountid, vtiger_users.user_name,vtiger_groups.groupname, vtiger_contactdetails.contactid, vtiger_contactdetails.lastname, vtiger_contactdetails.firstname, vtiger_contactdetails.title, vtiger_contactdetails.department, vtiger_contactdetails.email, vtiger_contactdetails.phone, vtiger_crmentity.crmid, vtiger_crmentity.smownerid, vtiger_crmentity.modifiedtime from vtiger_contactdetails inner join vtiger_campaigncontrel on vtiger_campaigncontrel.contactid = vtiger_contactdetails.contactid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_contactdetails.contactid left join vtiger_contactgrouprelation on vtiger_contactdetails.contactid=vtiger_contactgrouprelation.contactid left join vtiger_groups on vtiger_groups.groupname=vtiger_contactgrouprelation.groupname left join vtiger_users on vtiger_crmentity.smownerid=vtiger_users.id where vtiger_campaigncontrel.campaignid = '.$id.' and vtiger_crmentity.deleted=0';
 		
 		$log->debug("Exiting get_contacts method ...");
@@ -135,14 +141,17 @@
 	 */
 	function get_leads($id)
         {
-		global $log;
+		global $log, $singlepane_view;
                 $log->debug("Entering get_leads(".$id.") method ...");
                 global $mod_strings;
 
                 $focus = new Lead();
 
                 $button = '';
-                $returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Campaigns&return_action=DetailView&return_id='.$id;
+		else
+                	$returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
 
 		$query = 'SELECT vtiger_leaddetails.*, vtiger_crmentity.crmid, vtiger_users.user_name, vtiger_groups.groupname, vtiger_crmentity.smownerid from vtiger_leaddetails inner join vtiger_campaignleadrel on vtiger_campaignleadrel.leadid=vtiger_leaddetails.leadid inner join vtiger_crmentity on vtiger_crmentity.crmid = vtiger_leaddetails.leadid left join vtiger_users on vtiger_crmentity.smownerid = vtiger_users.id left join vtiger_leadgrouprelation on vtiger_leaddetails.leadid=vtiger_leadgrouprelation.leadid left join vtiger_groups on vtiger_groups.groupname=vtiger_leadgrouprelation.groupname where vtiger_crmentity.deleted=0 and vtiger_campaignleadrel.campaignid = '.$id;
 		$log->debug("Exiting get_leads method ...");
@@ -156,14 +165,17 @@
 	 */
 	function get_opportunities($id)
 	{
-		global $log;
+		global $log, $singlepane_view;
 		$log->debug("Entering get_opportunities(".$id.") method ...");
 		global $mod_strings;
 
 		$focus = new Potential();
 
 		$button = '';
-		$returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Campaigns&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
 
 		$query = 'select vtiger_users.user_name,vtiger_groups.groupname, 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_campaign inner join vtiger_potential on vtiger_campaign.campaignid = vtiger_potential.campaignid 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_campaign.campaignid = '.$id.' and vtiger_crmentity.deleted=0';
 		if($this->column_fields['account_id'] != 0)
@@ -179,7 +191,7 @@
 	 */
 	function get_activities($id)
 	{
-		global $log;
+		global $log, $singlepane_view;
 		$log->debug("Entering get_activities(".$id.") method ...");
 		global $app_strings;
 
@@ -189,7 +201,10 @@
 
 		$button = '';
 
-		$returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
+		if($singlepane_view == 'true')
+			$returnset = '&return_module=Campaigns&return_action=DetailView&return_id='.$id;
+		else
+			$returnset = '&return_module=Campaigns&return_action=CallRelatedList&return_id='.$id;
 
 		$query = "SELECT vtiger_contactdetails.lastname,
 			vtiger_contactdetails.firstname,

Modified: vtigercrm/trunk/modules/Campaigns/DetailView.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/DetailView.php (original)
+++ vtigercrm/trunk/modules/Campaigns/DetailView.php Wed Aug 23 23:10:05 2006
@@ -12,7 +12,9 @@
 require_once('include/database/PearDatabase.php');
 require_once('Smarty_setup.php');
 require_once('modules/Campaigns/Campaign.php');
+require_once('modules/CustomView/CustomView.php');
 require_once('include/utils/utils.php');
+require_once('user_privileges/default_module_view.php');
 
 $focus = new Campaign();
 
@@ -27,7 +29,7 @@
 {
         $focus->id = "";
 }
-global $app_strings,$mod_strings,$theme,$currentModule;
+global $app_strings,$mod_strings,$theme,$currentModule,$default_module_view;
 
 $theme_path="themes/".$theme."/";
 $image_path=$theme_path."images/";
@@ -69,6 +71,21 @@
 $check_button = Button_Check($module);
 $smarty->assign("CHECK", $check_button);
 
+if($singlepane_view == 'true')
+{
+	$related_array = getRelatedLists($currentModule,$focus);
+	$smarty->assign("RELATEDLISTS", $related_array);
+	$cvObj = new CustomView("Contacts");
+	$cvcombo = $cvObj->getCustomViewCombo();
+	$smarty->assign("CONTCVCOMBO","<select id='cont_cv_list' onchange='loadCvList(\"Contacts\",".$_REQUEST["record"].");'><option>-- ".$mod_strings['Select One']." --</option>".$cvcombo."</select>");
+
+	$cvObj = new CustomView("Leads");
+	$cvcombo = $cvObj->getCustomViewCombo();
+	$smarty->assign("LEADCVCOMBO","<select id='lead_cv_list' onchange='loadCvList(\"Leads\",".$_REQUEST["record"].");'> <option>-- ".$mod_strings['Select One']." --</option>".$cvcombo."</select>");
+}
+
+$smarty->assign("SinglePane_View", $singlepane_view);
+
 $smarty->assign("MODULE",$currentModule);
 $smarty->assign("EDIT_PERMISSION",isPermitted($currentModule,'EditView',$_REQUEST[record]));
 $smarty->display("DetailView.tpl");

Modified: vtigercrm/trunk/modules/Campaigns/LoadList.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/LoadList.php (original)
+++ vtigercrm/trunk/modules/Campaigns/LoadList.php Wed Aug 23 23:10:05 2006
@@ -1,34 +1,51 @@
-<?php
-/*********************************************************************************
-
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
- * Contributor(s): mmbrich
- ********************************************************************************/
-      
-require_once('modules/CustomView/CustomView.php');
-
-$cvObj = new CustomView($_REQUEST["return_type"]);
-
-$listquery = getListQuery($_REQUEST["list_type"]);
-$rs = $adb->query($cvObj->getModifiedCvListQuery($_REQUEST["cvid"],$listquery,$_REQUEST["list_type"]));
-
-if($_REQUEST["list_type"] == "Leads")
-		$reltable = "vtiger_campaignleadrel";
-elseif($_REQUEST["list_type"] == "Contacts")
-		$reltable = "vtiger_campaigncontrel";
-
-while($row=$adb->fetch_array($rs)) {
-	$adb->query("INSERT INTO ".$reltable." VALUES('".$_REQUEST["return_id"]."','".$row["crmid"]."')");
-}
-
-?>
-<script>
-addOnloadEvent(function() {
-	window.location.href = "index.php?action=CallRelatedList&module=Campaigns&record=<? echo $_REQUEST['return_id'];?>";
-});
-</script>
+<?php
+/*********************************************************************************
+
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+ * Contributor(s): mmbrich
+ ********************************************************************************/
+      
+require_once('modules/CustomView/CustomView.php');
+require_once('user_privileges/default_module_view.php');
+
+global $singlepane_view;
+$cvObj = new CustomView($_REQUEST["return_type"]);
+
+$listquery = getListQuery($_REQUEST["list_type"]);
+$rs = $adb->query($cvObj->getModifiedCvListQuery($_REQUEST["cvid"],$listquery,$_REQUEST["list_type"]));
+
+if($_REQUEST["list_type"] == "Leads")
+		$reltable = "vtiger_campaignleadrel";
+elseif($_REQUEST["list_type"] == "Contacts")
+		$reltable = "vtiger_campaigncontrel";
+
+while($row=$adb->fetch_array($rs)) {
+	$adb->query("INSERT INTO ".$reltable." VALUES('".$_REQUEST["return_id"]."','".$row["crmid"]."')");
+}
+
+if ($singlepane_view == 'true')
+{
+?>
+<script>
+addOnloadEvent(function() {
+	window.location.href = "index.php?action=DetailView&module=Campaigns&record=<? echo $_REQUEST['return_id'];?>";
+});
+</script>
+<?php
+}
+else
+{
+?>
+<script>
+addOnloadEvent(function() {
+	window.location.href = "index.php?action=CallRelatedList&module=Campaigns&record=<? echo $_REQUEST['return_id'];?>";
+});
+</script>
+<?php
+}
+?>

Modified: vtigercrm/trunk/modules/Campaigns/updateRelations.php
==============================================================================
--- vtigercrm/trunk/modules/Campaigns/updateRelations.php (original)
+++ vtigercrm/trunk/modules/Campaigns/updateRelations.php Wed Aug 23 23:10:05 2006
@@ -1,53 +1,61 @@
-<?php
-/*********************************************************************************
-** The contents of this file are subject to the vtiger CRM Public License Version 1.0
- * ("License"); You may not use this file except in compliance with the License
- * The Original Code is:  vtiger CRM Open Source
- * The Initial Developer of the Original Code is vtiger.
- * Portions created by vtiger are Copyright (C) vtiger.
- * All Rights Reserved.
-*
- ********************************************************************************/
-
-require_once('include/database/PearDatabase.php');
-global $adb;
-$idlist = $_REQUEST['idlist'];
-$update_mod = $_REQUEST['destination_module'];
-if($update_mod == 'Leads')
-{
-	$rel_table = 'vtiger_campaignleadrel';
-	$mod_table = 'vtiger_leaddetails';
-	$mod_field = 'leadid';
-}
-elseif($update_mod == 'Contacts')
-{
-	$rel_table = 'vtiger_campaigncontrel';
-	$mod_table = 'vtiger_contactdetails';
-	$mod_field = 'contactid';
-}
-if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '')
-{
-	//split the string and store in an array
-	$storearray = explode (";",$idlist);
-	foreach($storearray as $id)
-	{
-		if($id != '')
-		{
-		    $sql = "insert into  ".$rel_table." values(".$_REQUEST["parentid"]." , ".$id.")";
-	            $adb->query($sql);
-		    $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parentid"]." where ".$mod_field." = ".$id;
-                    $adb->query($sql);
-		}
-	}
- 		header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parentid"]);
-}
-elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '')
-{	
-		$sql = "insert into ".$rel_table." values(".$_REQUEST["parid"].",".$_REQUEST["entityid"].")";
-		$adb->query($sql);
-		$sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parid"]." where ".$mod_field." = ".$_REQUEST["entityid"];
-                $adb->query($sql);
- 		header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parid"]);
-}
-
-?>
+<?php
+/*********************************************************************************
+** The contents of this file are subject to the vtiger CRM Public License Version 1.0
+ * ("License"); You may not use this file except in compliance with the License
+ * The Original Code is:  vtiger CRM Open Source
+ * The Initial Developer of the Original Code is vtiger.
+ * Portions created by vtiger are Copyright (C) vtiger.
+ * All Rights Reserved.
+*
+ ********************************************************************************/
+
+require_once('include/database/PearDatabase.php');
+require_once('user_privileges/default_module_view.php');
+global $adb, $singlepane_view;
+$idlist = $_REQUEST['idlist'];
+$update_mod = $_REQUEST['destination_module'];
+if($update_mod == 'Leads')
+{
+	$rel_table = 'vtiger_campaignleadrel';
+	$mod_table = 'vtiger_leaddetails';
+	$mod_field = 'leadid';
+}
+elseif($update_mod == 'Contacts')
+{
+	$rel_table = 'vtiger_campaigncontrel';
+	$mod_table = 'vtiger_contactdetails';
+	$mod_field = 'contactid';
+}
+if(isset($_REQUEST['idlist']) && $_REQUEST['idlist'] != '')
+{
+	//split the string and store in an array
+	$storearray = explode (";",$idlist);
+	foreach($storearray as $id)
+	{
+		if($id != '')
+		{
+		    $sql = "insert into  ".$rel_table." values(".$_REQUEST["parentid"]." , ".$id.")";
+	            $adb->query($sql);
+		    $sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parentid"]." where ".$mod_field." = ".$id;
+                    $adb->query($sql);
+		}
+	}
+	if($singlepane_view == 'true')
+		header("Location: index.php?action=DetailView&module=Campaigns&record=".$_REQUEST["parentid"]);
+	else
+ 		header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parentid"]);
+}
+elseif(isset($_REQUEST['entityid']) && $_REQUEST['entityid'] != '')
+{	
+		$sql = "insert into ".$rel_table." values(".$_REQUEST["parid"].",".$_REQUEST["entityid"].")";
+		$adb->query($sql);
+		$sql = "update ".$mod_table." set campaignid = ".$_REQUEST["parid"]." where ".$mod_field." = ".$_REQUEST["entityid"];
+                $adb->query($sql);
+		
+		if($singlepane_view == 'true')
+			header("Location: index.php?action=DetailView&module=Campaigns&record=".$_REQUEST["parid"]);
+		else
+ 			header("Location: index.php?action=CallRelatedList&module=Campaigns&record=".$_REQUEST["parid"]);
+}
+
+?>





More information about the vtigercrm-commits mailing list