public_html/layouts/basic/modules/Contacts/resources/Edit.min.js
'use strict';
/*+***********************************************************************************
* 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.
*************************************************************************************/"use strict";Vtiger_Edit_Js("Contacts_Edit_Js",{},{/**
* Function to check for Portal User
*/checkForPortalUser:function checkForPortalUser(form){var element=jQuery("[name=\"portal\"]",form),response=element.is(":checked"),primaryEmailField=jQuery("[name=\"email\"]"),primaryEmailValue=primaryEmailField.val();if(response){if(0==primaryEmailField.length)return app.showNotify({text:app.vtranslate("JS_PRIMARY_EMAIL_FIELD_DOES_NOT_EXISTS"),type:"error"}),!1;if(""==primaryEmailValue)return app.showNotify({text:app.vtranslate("JS_PLEASE_ENTER_PRIMARY_EMAIL_VALUE_TO_ENABLE_PORTAL_USER"),type:"info"}),!1}return !0},/**
* Function to register recordpresave event
*/registerRecordPreSaveEvent:function registerRecordPreSaveEvent(form){var thisInstance=this;"undefined"==typeof form&&(form=this.getForm()),form.on(Vtiger_Edit_Js.recordPreSave,function(e){var result=thisInstance.checkForPortalUser(form);result||e.preventDefault();});},registerBasicEvents:function registerBasicEvents(container){this._super(container),this.registerRecordPreSaveEvent(container);}});
//# sourceMappingURL=Edit.min.js.map