[Vtigercrm-commits] [vtiger-commits] r9551 - in /vtigercrm/branches/5.0.1: Popup.php Smarty/templates/Popup.tpl Smarty/templates/RelatedListContents.tpl modules/Products/updateRelations.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Oct 3 10:22:38 EDT 2006


Author: richie
Date: Tue Oct  3 08:22:32 2006
New Revision: 9551

Log:
* Changes made to add the button Select Product in Vendor Related list

Modified:
    vtigercrm/branches/5.0.1/Popup.php
    vtigercrm/branches/5.0.1/Smarty/templates/Popup.tpl
    vtigercrm/branches/5.0.1/Smarty/templates/RelatedListContents.tpl
    vtigercrm/branches/5.0.1/modules/Products/updateRelations.php

Modified: vtigercrm/branches/5.0.1/Popup.php
==============================================================================
--- vtigercrm/branches/5.0.1/Popup.php (original)
+++ vtigercrm/branches/5.0.1/Popup.php Tue Oct  3 08:22:32 2006
@@ -195,6 +195,7 @@
 
 
 }
+$smarty->assign("RETURN_ACTION",$_REQUEST['return_action']);
 
 
 $theme_path="themes/".$theme."/";

Modified: vtigercrm/branches/5.0.1/Smarty/templates/Popup.tpl
==============================================================================
--- vtigercrm/branches/5.0.1/Smarty/templates/Popup.tpl (original)
+++ vtigercrm/branches/5.0.1/Smarty/templates/Popup.tpl Tue Oct  3 08:22:32 2006
@@ -18,7 +18,7 @@
 <script language="javascript" type="text/javascript" src="include/scriptaculous/prototype.js"></script>
 <script type="text/javascript">
 function add_data_to_relatedlist(entity_id,recordid,mod) {ldelim}
-        opener.document.location.href="index.php?module={$RETURN_MODULE}&action=updateRelations&destination_module="+mod+"&entityid="+entity_id+"&parid="+recordid;
+        opener.document.location.href="index.php?module={$RETURN_MODULE}&action=updateRelations&destination_module="+mod+"&entityid="+entity_id+"&parid="+recordid+"&return_action={$RETURN_ACTION}";
 {rdelim}
 
 </script>

Modified: vtigercrm/branches/5.0.1/Smarty/templates/RelatedListContents.tpl
==============================================================================
--- vtigercrm/branches/5.0.1/Smarty/templates/RelatedListContents.tpl (original)
+++ vtigercrm/branches/5.0.1/Smarty/templates/RelatedListContents.tpl Tue Oct  3 08:22:32 2006
@@ -37,15 +37,16 @@
                                 {/if}
                         {elseif $header eq 'Products'}
                                 {if $MODULE eq 'PriceBooks'}
-                                <input title="{$APP.LBL_SELECT_PRODUCT_BUTTON_LABEL}" accessKey="" class="crmbutton small edit" value="{$APP.LBL_SELECT_PRODUCT_BUTTON_LABEL}" LANGUAGE=javascript onclick="this.form.action.value='AddProductsToPriceBook';this.form.module.value='Products';this.form.return_module.value='Products';this.form.return_action.value='PriceBookDetailView'"  type="submit" name="button"></td>
+	                                <input title="{$APP.LBL_SELECT_PRODUCT_BUTTON_LABEL}" accessKey="" class="crmbutton small edit" value="{$APP.LBL_SELECT_PRODUCT_BUTTON_LABEL}" LANGUAGE=javascript onclick="this.form.action.value='AddProductsToPriceBook';this.form.module.value='Products';this.form.return_module.value='Products';this.form.return_action.value='PriceBookDetailView'"  type="submit" name="button"></td>
 				{elseif $MODULE eq 'Potentials'}
 					<input title="Change" accessKey="" class="crmbutton small save" value="{$APP.LBL_SELECT_BUTTON_LABEL} {$APP.Product}" LANGUAGE=javascript onclick='return window.open("index.php?module=Products&return_module={$MODULE}&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid={$ID}","test","width=640,height=602,resizable=0,scrollbars=0");' type="button"  name="button">&nbsp;
 					<input title="{$APP.LBL_ADD_NEW} {$APP.Product}" accessyKey="F" class="crmbutton small save" onclick="this.form.action.value='EditView';this.form.module.value='Products';this.form.return_module.value='{$MODULE}';this.form.return_action.value='{$return_modname}'" type="submit" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Product}"></td>
-					
+
 				{elseif $MODULE eq 'Vendors'}
+					<input title="{$APP.LBL_SELECT_BUTTON_LABEL} {$APP.Product}" accessyKey="F" class="crmbutton small create" LANGUAGE=javascript onclick='return window.open("index.php?module=Products&return_module=Products&action=Popup&return_action={$return_modname}&popuptype=detailview&form=DetailView&form_submit=false&recordid={$ID}","test","width=640,height=602,resizable=0,scrollbars=0");' type="button" name="button" value="{$APP.LBL_SELECT_BUTTON_LABEL} {$APP.Product}">
 					<input title="{$APP.LBL_ADD_NEW} {$APP.Product}" accessyKey="F" class="crmbutton small create" onclick="this.form.action.value='EditView';this.form.module.value='Products';this.form.return_module.value='{$MODULE}';this.form.return_action.value='{$return_modname}'; this.form.parent_id.value='';" type="submit" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Product}"></td>
                                 {else}
-				<input title="{$APP.LBL_ADD_NEW} {$APP.Product}" accessyKey="F" class="crmbutton small create" onclick="this.form.action.value='EditView';this.form.module.value='Products';this.form.return_module.value='{$MODULE}';this.form.return_action.value='{$return_modname}'" type="submit" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Product}"></td>
+					<input title="{$APP.LBL_ADD_NEW} {$APP.Product}" accessyKey="F" class="crmbutton small create" onclick="this.form.action.value='EditView';this.form.module.value='Products';this.form.return_module.value='{$MODULE}';this.form.return_action.value='{$return_modname}'" type="submit" name="button" value="{$APP.LBL_ADD_NEW} {$APP.Product}"></td>
 				{/if}
 			{elseif $header eq 'Leads'}
 				{if $MODULE eq 'Campaigns'}

Modified: vtigercrm/branches/5.0.1/modules/Products/updateRelations.php
==============================================================================
--- vtigercrm/branches/5.0.1/modules/Products/updateRelations.php (original)
+++ vtigercrm/branches/5.0.1/modules/Products/updateRelations.php Tue Oct  3 08:22:32 2006
@@ -12,11 +12,12 @@
 require_once('include/database/PearDatabase.php');
 global $adb;
 
+//This if will be true, when we select product from vendor related list
 if($_REQUEST['destination_module']=='Products')
 {
-	if($_REQUEST['smodule']=='VENDOR')
+	if($_REQUEST['parid'] != '' && $_REQUEST['entityid'] != '')
 	{
-		$sql = "update vtiger_products set vtiger_vendor_id=".$_REQUEST['parid']." where productid=".$_REQUEST['entityid'];
+		$sql = "update vtiger_products set vendor_id=".$_REQUEST['parid']." where productid=".$_REQUEST['entityid'];
 		$adb->query($sql);
 	}
 }
@@ -29,8 +30,11 @@
 	}
 }
 
+$return_action = 'DetailView';
+if($_REQUEST['return_action'] != '')
+	$return_action = $_REQUEST['return_action'];
 
- header("Location:index.php?action=DetailView&module=Vendors&record=".$_REQUEST["parid"]);
+header("Location:index.php?action=$return_action&module=Vendors&record=".$_REQUEST["parid"]);
 
 
 





More information about the vtigercrm-commits mailing list