Files
CRM/layouts/vlayout/modules/Potentials/resources/Edit.js
BACHIR SOULDI 2794e62571 first commit
2025-09-28 08:49:37 +01:00

42 lines
1.5 KiB
JavaScript

/*+***********************************************************************************
* 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.
*************************************************************************************/
Vtiger_Edit_Js("Potentials_Edit_Js",{ },{
/**
* Function to get popup params
**/
getPopUpParams : function(container) {
var params = this._super(container);
var sourceFieldElement = jQuery('input[class="sourceField"]',container);
if(sourceFieldElement.attr('name') == 'contact_id' ) {
var form = this.getForm();
var parentIdElement = form.find('[name="related_to"]');
if(parentIdElement.length > 0 && parentIdElement.val().length > 0 && parentIdElement.val() != 0) {
var closestContainer = parentIdElement.closest('td');
params['related_parent_id'] = parentIdElement.val();
params['related_parent_module'] = closestContainer.find('[name="popupReferenceModule"]').val();
}
}
return params;
},
registerEvents: function(){
this._super();
}
});