| [ 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 Vtiger_Detail_Js("Contacts_Detail_Js",{},{ 11 12 /** 13 * Function to register recordpresave event 14 */ 15 registerRecordPreSaveEvent : function(form){ 16 var thisInstance = this; 17 var primaryEmailField = jQuery('[name="email"]'); 18 if(typeof form == 'undefined') { 19 form = this.getForm(); 20 } 21 22 form.on(this.fieldPreSave,'[name="portal"]', function(e, data) { 23 var portalField = jQuery(e.currentTarget); 24 25 var primaryEmailValue = primaryEmailField.val(); 26 var isAlertAlreadyShown = jQuery('.ui-pnotify').length; 27 28 29 if(portalField.is(':checked')){ 30 if(primaryEmailField.length == 0){ 31 if(isAlertAlreadyShown <= 0) { 32 Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_PRIMARY_EMAIL_FIELD_DOES_NOT_EXISTS')); 33 } 34 e.preventDefault(); 35 } 36 if(primaryEmailValue == ""){ 37 if(isAlertAlreadyShown <= 0) { 38 Vtiger_Helper_Js.showPnotify(app.vtranslate('JS_PLEASE_ENTER_PRIMARY_EMAIL_VALUE_TO_ENABLE_PORTAL_USER')); 39 } 40 e.preventDefault(); 41 } 42 } 43 }) 44 }, 45 46 /** 47 * Function which will register all the events 48 */ 49 registerEvents : function() { 50 var form = this.getForm(); 51 this._super(); 52 this.registerRecordPreSaveEvent(form); 53 } 54 })
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 |