YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Contacts/resources/Detail.min.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"Detail.min.js","sources":["Detail.js"],"sourcesContent":["/*+***********************************************************************************\n * The contents of this file are subject to the vtiger CRM Public License Version 1.0\n * (\"License\"); You may not use this file except in compliance with the License\n * The Original Code is:  vtiger CRM Open Source\n * The Initial Developer of the Original Code is vtiger.\n * Portions created by vtiger are Copyright (C) vtiger.\n * All Rights Reserved.\n *************************************************************************************/\n'use strict';\n\nVtiger_Detail_Js(\n\t'Contacts_Detail_Js',\n\t{},\n\t{\n\t\thierarchyResponseCache: {},\n\t\t/**\n\t\t * Function to register recordpresave event\n\t\t */\n\t\tregisterRecordPreSaveEvent: function (form) {\n\t\t\tvar primaryEmailField = jQuery('[name=\"email\"]');\n\t\t\tif (typeof form === 'undefined') {\n\t\t\t\tform = this.getForm();\n\t\t\t}\n\n\t\t\tform.on(this.fieldPreSave, '[name=\"portal\"]', function (e, data) {\n\t\t\t\tvar portalField = jQuery(e.currentTarget);\n\n\t\t\t\tvar primaryEmailValue = primaryEmailField.val();\n\t\t\t\tvar isAlertAlreadyShown = jQuery('.ui-pnotify').length;\n\n\t\t\t\tif (portalField.is(':checked')) {\n\t\t\t\t\tif (primaryEmailField.length == 0) {\n\t\t\t\t\t\tif (isAlertAlreadyShown <= 0) {\n\t\t\t\t\t\t\tapp.showNotify({\n\t\t\t\t\t\t\t\ttext: app.vtranslate('JS_PRIMARY_EMAIL_FIELD_DOES_NOT_EXISTS'),\n\t\t\t\t\t\t\t\ttype: 'error'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t\tif (primaryEmailValue == '') {\n\t\t\t\t\t\tif (isAlertAlreadyShown <= 0) {\n\t\t\t\t\t\t\tapp.showNotify({\n\t\t\t\t\t\t\t\ttext: app.vtranslate('JS_PLEASE_ENTER_PRIMARY_EMAIL_VALUE_TO_ENABLE_PORTAL_USER'),\n\t\t\t\t\t\t\t\ttype: 'info'\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\te.preventDefault();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\n\t\t/**\n\t\t * Function to get response from hierarchy\n\t\t * @param {array} params\n\t\t * @returns {Promise}\n\t\t */\n\t\tgetHierarchyResponseData: function (params) {\n\t\t\tlet thisInstance = this,\n\t\t\t\taDeferred = jQuery.Deferred();\n\n\t\t\tif (!$.isEmptyObject(thisInstance.hierarchyResponseCache)) {\n\t\t\t\taDeferred.resolve(thisInstance.hierarchyResponseCache);\n\t\t\t} else {\n\t\t\t\tAppConnector.request(params).then(function (data) {\n\t\t\t\t\tthisInstance.hierarchyResponseCache = data;\n\t\t\t\t\taDeferred.resolve(thisInstance.hierarchyResponseCache);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn aDeferred.promise();\n\t\t},\n\t\t/**\n\t\t * function to display the hierarchy response data\n\t\t * @param {array} data\n\t\t */\n\t\tdisplayHierarchyResponseData: function (data) {\n\t\t\tlet callbackFunction = function () {\n\t\t\t\tapp.showScrollBar($('#hierarchyScroll'), {\n\t\t\t\t\theight: '300px',\n\t\t\t\t\trailVisible: true,\n\t\t\t\t\tsize: '6px'\n\t\t\t\t});\n\t\t\t};\n\t\t\tapp.showModalWindow(data, function (modalContainer) {\n\t\t\t\tApp.Components.Scrollbar.xy($('#hierarchyScroll', modalContainer));\n\t\t\t\tif (typeof callbackFunction == 'function' && $('#hierarchyScroll', modalContainer).height() > 300) {\n\t\t\t\t\tcallbackFunction();\n\t\t\t\t}\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Registers read count of hierarchy if it is possoble\n\t\t */\n\t\tregisterHierarchyRecordCount: function () {\n\t\t\tlet hierarchyButton = $('.js-detail-hierarchy'),\n\t\t\t\tparams = {\n\t\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\t\taction: 'RelationAjax',\n\t\t\t\t\trecord: app.getRecordId(),\n\t\t\t\t\tmode: 'getHierarchyCount'\n\t\t\t\t};\n\t\t\tif (hierarchyButton.length) {\n\t\t\t\tAppConnector.request(params).then(function (response) {\n\t\t\t\t\tif (response.success) {\n\t\t\t\t\t\t$('.hierarchy .badge').html(response.result);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t/**\n\t\t * Shows hierarchy\n\t\t */\n\t\tregisterShowHierarchy: function () {\n\t\t\tlet thisInstance = this,\n\t\t\t\thierarchyButton = $('.detailViewTitle'),\n\t\t\t\tparams = {\n\t\t\t\t\tmodule: app.getModuleName(),\n\t\t\t\t\tview: 'Hierarchy',\n\t\t\t\t\trecord: app.getRecordId()\n\t\t\t\t};\n\t\t\thierarchyButton.on('click', '.js-detail-hierarchy', function () {\n\t\t\t\tlet progressIndicatorElement = $.progressIndicator({\n\t\t\t\t\tposition: 'html',\n\t\t\t\t\tblockInfo: {\n\t\t\t\t\t\tenabled: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthisInstance.getHierarchyResponseData(params).then(function (data) {\n\t\t\t\t\tthisInstance.displayHierarchyResponseData(data);\n\t\t\t\t\tprogressIndicatorElement.progressIndicator({ mode: 'hide' });\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\t/**\n\t\t * Function which will register all the events\n\t\t */\n\t\tregisterEvents: function () {\n\t\t\tvar form = this.getForm();\n\t\t\tthis._super();\n\t\t\tthis.registerHierarchyRecordCount();\n\t\t\tthis.registerShowHierarchy();\n\t\t\tthis.registerRecordPreSaveEvent(form);\n\t\t}\n\t}\n);\n"],"names":["Vtiger_Detail_Js","hierarchyResponseCache","registerRecordPreSaveEvent","form","primaryEmailField","jQuery","getForm","on","fieldPreSave","e","portalField","currentTarget","primaryEmailValue","val","isAlertAlreadyShown","length","is","app","showNotify","text","vtranslate","type","preventDefault","getHierarchyResponseData","params","thisInstance","aDeferred","Deferred","$","isEmptyObject","AppConnector","request","then","data","resolve","promise","displayHierarchyResponseData","callbackFunction","showScrollBar","height","railVisible","size","showModalWindow","modalContainer","App","Components","Scrollbar","xy","registerHierarchyRecordCount","hierarchyButton","module","getModuleName","action","record","getRecordId","mode","response","success","html","result","registerShowHierarchy","view","progressIndicatorElement","progressIndicator","position","blockInfo","enabled","registerEvents","_super"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFACA,YAAY,CAEZA,gBAAgB,CACf,oBAAoB,CACpB,EAAE,CACF,CACCC,sBAAsB,CAAE,EAAE;AAE5B;AACA,KACEC,0BAA0B,CAAE,SAAAA,0BAAAA,CAAUC,IAAI,CAAE,CAC3C,IAAIC,iBAAiB,CAAGC,MAAM,CAAC,kBAAgB,CAAC,CAC5B,WAAW,EAA3B,OAAOF,IAAoB,GAC9BA,IAAI,CAAG,IAAI,CAACG,OAAO,EAAE,CAGtBH,CAAAA,IAAI,CAACI,EAAE,CAAC,IAAI,CAACC,YAAY,CAAE,mBAAiB,CAAE,SAAUC,CAAC,CAAQ,CAC5D,IAAAC,WAAW,CAAGL,MAAM,CAACI,CAAC,CAACE,aAAa,CAAC,CAErCC,iBAAiB,CAAGR,iBAAiB,CAACS,GAAG,EAAE,CAC3CC,mBAAmB,CAAGT,MAAM,CAAC,aAAa,CAAC,CAACU,MAAM,CAElDL,WAAW,CAACM,EAAE,CAAC,UAAU,CAAC,GACG,CAAC,EAA7BZ,iBAAiB,CAACW,MAAW,GACL,CAAC,EAAxBD,mBAAwB,EAC3BG,GAAG,CAACC,UAAU,CAAC,CACdC,IAAI,CAAEF,GAAG,CAACG,UAAU,CAAC,wCAAwC,CAAC,CAC9DC,IAAI,CAAE,OACP,CAAC,CAAC,CAEHZ,CAAC,CAACa,cAAc,EAAE,CAAA,CAEM,EAAE,EAAvBV,iBAAuB,GACC,CAAC,EAAxBE,mBAAwB,EAC3BG,GAAG,CAACC,UAAU,CAAC,CACdC,IAAI,CAAEF,GAAG,CAACG,UA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