YetiForceCompany/YetiForceCRM

View on GitHub
public_html/layouts/basic/modules/Vtiger/resources/BasicSearch.min.js.map

Summary

Maintainability
Test Coverage
{"version":3,"file":"BasicSearch.min.js","sources":["BasicSearch.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\njQuery.Class(\n\t'Vtiger_BasicSearch_Js',\n\t{},\n\t{\n\t\t//stores the module that need to be searched\n\t\tsearchModule: false,\n\t\t//stores the module that need to be searched which is selected by the user\n\t\tcurrentSearchModule: false,\n\t\t// reduce the number of results\n\t\treduceNumberResults: false,\n\t\t// Should the result be in html\n\t\treturnHtml: true,\n\t\t// Main container with modules, value and buttons\n\t\tmainContainer: false,\n\t\t/**\n\t\t * Function to get the search module\n\t\t */\n\t\tgetSearchModule: function () {\n\t\t\tif (this.searchModule === false) {\n\t\t\t\t//default gives current module\n\t\t\t\tlet module = app.getModuleName();\n\t\t\t\tif (typeof this.getCurrentSearchModule() !== 'undefined') {\n\t\t\t\t\tmodule = this.getCurrentSearchModule();\n\t\t\t\t}\n\n\t\t\t\tthis.setSearchModule(module);\n\t\t\t}\n\t\t\treturn this.searchModule;\n\t\t},\n\t\t/**\n\t\t * Function to set the search module\n\t\t */\n\t\tsetSearchModule: function (moduleName) {\n\t\t\tthis.searchModule = moduleName;\n\t\t\treturn this;\n\t\t},\n\t\t/**\n\t\t * Function to set main conatainer\n\t\t */\n\t\tsetMainContainer: function (container) {\n\t\t\tthis.mainContainer = container;\n\t\t\treturn this;\n\t\t},\n\t\t/**\n\t\t * Function to get the user selected search module\n\t\t */\n\t\tgetCurrentSearchModule: function () {\n\t\t\tif (this.currentSearchModule === false && this.mainContainer) {\n\t\t\t\tthis.currentSearchModule = this.mainContainer.find('.basicSearchModulesList').val();\n\t\t\t}\n\t\t\treturn this.currentSearchModule;\n\t\t},\n\t\t/**\n\t\t * Function which will perform the search\n\t\t */\n\t\t_search: function (params) {\n\t\t\tlet aDeferred = jQuery.Deferred();\n\t\t\tif (typeof params === 'undefined') {\n\t\t\t\tparams = {};\n\t\t\t}\n\t\t\tif (params.searchModule && params.searchModule !== '-') {\n\t\t\t\tparams.module = params.searchModule;\n\t\t\t} else {\n\t\t\t\tparams.module = app.getModuleName();\n\t\t\t}\n\t\t\tparams.view = 'BasicAjax';\n\t\t\tparams.mode = 'showSearchResults';\n\t\t\tparams.limit = this.reduceNumberResults;\n\t\t\tparams.html = this.returnHtml;\n\t\t\tif (app.getParentModuleName()) {\n\t\t\t\tparams.parent = app.getParentModuleName();\n\t\t\t}\n\t\t\tparams.operator = CONFIG.globalSearchDefaultOperator;\n\t\t\tif (this.mainContainer) {\n\t\t\t\tlet operatorElement = this.mainContainer.find('.js-global-search-operator .active[data-operator]');\n\t\t\t\tif (operatorElement.length && operatorElement.data('operator') != '') {\n\t\t\t\t\tparams.operator = operatorElement.data('operator');\n\t\t\t\t}\n\t\t\t}\n\t\t\tAppConnector.request(params)\n\t\t\t\t.done(function (data) {\n\t\t\t\t\taDeferred.resolve(data);\n\t\t\t\t})\n\t\t\t\t.fail(function (error, err) {\n\t\t\t\t\taDeferred.reject(error);\n\t\t\t\t});\n\t\t\treturn aDeferred.promise();\n\t\t},\n\t\t/**\n\t\t * Helper function whicn invokes search\n\t\t */\n\t\tsearch: function (value) {\n\t\t\tlet searchModule = this.getCurrentSearchModule();\n\t\t\tlet params = {};\n\t\t\tparams.value = value;\n\t\t\tif (typeof searchModule !== 'undefined' && searchModule !== false) {\n\t\t\t\tparams.searchModule = searchModule;\n\t\t\t} else if (this.searchModule) {\n\t\t\t\tparams.searchModule = this.searchModule;\n\t\t\t}\n\t\t\treturn this._search(params);\n\t\t},\n\t\t/**\n\t\t * Function which shows the search results\n\t\t */\n\t\tshowSearchResults: function (data) {\n\t\t\tlet aDeferred = jQuery.Deferred();\n\t\t\tlet postLoad = function (data) {\n\t\t\t\taDeferred.resolve(data);\n\t\t\t};\n\t\t\tlet params = {};\n\t\t\tparams.data = data;\n\t\t\tparams.cb = postLoad;\n\t\t\tapp.showModalWindow(params);\n\t\t\treturn aDeferred.promise();\n\t\t}\n\t}\n);\n"],"names":["jQuery","Class","searchModule","currentSearchModule","reduceNumberResults","returnHtml","mainContainer","getSearchModule","module","app","getModuleName","getCurrentSearchModule","setSearchModule","moduleName","setMainContainer","container","find","val","_search","params","aDeferred","Deferred","view","mode","limit","html","getParentModuleName","parent","operator","CONFIG","globalSearchDefaultOperator","operatorElement","length","data","AppConnector","request","done","resolve","fail","error","reject","promise","search","value","showSearchResults","cb","postLoad","showModalWindow"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uFACA,YAAY,CAEZA,MAAM,CAACC,KAAK,CACX,uBAAuB,CACvB,EAAE,CACF;AAECC,YAAY,GAAO;AAEnBC,mBAAmB,GAAO;AAE1BC,mBAAmB,GAAO;AAE1BC,UAAU,GAAM;AAEhBC,aAAa,GAAO;AAEtB;AACA,KACEC,eAAe,CAAE,SAAAA,eAAA,EAAY,CAC5B,GAAI,CAAI,CAAA,GAAA,IAAA,CAACL,YAAsB,CAAE;AAEhC,IAAIM,MAAM,CAAGC,GAAG,CAACC,aAAa,EAAE,CACa,WAAW,EAApD,OAAO,IAAI,CAACC,sBAAsB,EAAkB,GACvDH,MAAM,CAAG,IAAI,CAACG,sBAAsB,EAAE,CAAA,CAGvC,IAAI,CAACC,eAAe,CAACJ,MAAM,EAC5B,CACA,WAAW,CAACN,YACb,CAAC;AAEH;AACA,KACEU,eAAe,CAAE,SAAAA,eAAUC,CAAAA,UAAU,CAAE,CAEtC,OADI,IAAA,CAACX,YAAY,CAAGW,UAAU,CACvB,IACR,CAAC;AAEH;AACA,KACEC,gBAAgB,CAAE,SAAAA,gBAAUC,CAAAA,SAAS,CAAE,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