[ Index ] |
PHP Cross Reference of vtigercrm-6.1.0 |
[Summary view] [Print] [Text view]
1 /*+*********************************************************************************** 2 * The contents of this file are subject to the vtiger CRM Public License Version 1.0 3 * ("License"); You may not use this file except in compliance with the License 4 * The Original Code is: vtiger CRM Open Source 5 * The Initial Developer of the Original Code is vtiger. 6 * Portions created by vtiger are Copyright (C) vtiger. 7 * All Rights Reserved. 8 *************************************************************************************/ 9 10 Inventory_Edit_Js("PurchaseOrder_Edit_Js",{},{ 11 12 /** 13 * Function to get popup params 14 */ 15 getPopUpParams : function(container) { 16 var params = this._super(container); 17 var sourceFieldElement = jQuery('input[class="sourceField"]',container); 18 19 if(sourceFieldElement.attr('name') == 'contact_id') { 20 var form = this.getForm(); 21 var parentIdElement = form.find('[name="vendor_id"]'); 22 if(parentIdElement.length > 0 && parentIdElement.val().length > 0 && parentIdElement.val() != 0) { 23 var closestContainer = parentIdElement.closest('td'); 24 params['related_parent_id'] = parentIdElement.val(); 25 params['related_parent_module'] = closestContainer.find('[name="popupReferenceModule"]').val(); 26 } 27 } 28 return params; 29 }, 30 31 /** 32 * Function to search module names 33 */ 34 searchModuleNames : function(params) { 35 var aDeferred = jQuery.Deferred(); 36 37 if(typeof params.module == 'undefined') { 38 params.module = app.getModuleName(); 39 } 40 if(typeof params.action == 'undefined') { 41 params.action = 'BasicAjax'; 42 } 43 44 if (params.search_module == 'Contacts') { 45 var form = this.getForm(); 46 var parentIdElement = form.find('[name="vendor_id"]'); 47 if(parentIdElement.length > 0 && parentIdElement.val().length > 0) { 48 var closestContainer = parentIdElement.closest('td'); 49 params.parent_id = parentIdElement.val(); 50 params.parent_module = closestContainer.find('[name="popupReferenceModule"]').val(); 51 } 52 } 53 54 AppConnector.request(params).then( 55 function(data){ 56 aDeferred.resolve(data); 57 }, 58 function(error){ 59 aDeferred.reject(); 60 } 61 ) 62 return aDeferred.promise(); 63 }, 64 65 /** 66 * Function which will register event for Reference Fields Selection 67 */ 68 registerReferenceSelectionEvent : function(container) { 69 this._super(container); 70 var thisInstance = this; 71 72 jQuery('input[name="vendor_id"]', container).on(Vtiger_Edit_Js.referenceSelectionEvent, function(e, data){ 73 thisInstance.referenceSelectionEventHandler(data, container); 74 }); 75 }, 76 77 78 registerEvents: function(){ 79 this._super(); 80 this.registerEventForCopyAddress(); 81 } 82 }); 83 84
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 20:08:37 2014 | Cross-referenced by PHPXref 0.7.1 |