1 line
39 KiB
JavaScript
1 line
39 KiB
JavaScript
|
(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["search_panel-SearchPanel"],{4057:(__unused_webpack_module,__unused_webpack_exports,__webpack_require__)=>{eval("/* provided dependency */ var jQuery = __webpack_require__(9755);\n( function( $ ) {\n\n\t$.fn.SearchPanel = function( options ) {\n\t\tvar opts = $.extend( {}, $.fn.SearchPanel.defaults, options );\n\n\t\tvar is_collapsed = true;\n\n\t\tvar layouts_array = null;\n\n\t\tvar related_view_controller = null;\n\n\t\tvar $this = this;\n\n\t\tvar tab;\n\n\t\tvar select_tab_index = 0;\n\n\t\tvar select_tab = null;\n\n\t\tvar last_select_tab_index = 0;\n\n\t\tvar last_select_tab = null;\n\n\t\tvar trigger_change_event = true;\n\n\t\tvar hidedAdvTab = false;\n\n//\t\tGlobal.addCss( 'global/widgets/search_panel/SearchPanel.css' );\n\n\t\tthis.isAdvTabVisible = function() {\n\t\t\treturn !hidedAdvTab;\n\t\t};\n\n\t\tthis.isCollapsed = function() {\n\t\t\treturn is_collapsed;\n\t\t};\n\n\t\tthis.hideAdvSearchPanel = function() {\n\t\t\t$( tab ).find( 'li[aria-controls=adv_search]' ).remove();\n\t\t\thidedAdvTab = true;\n\t\t};\n\n\t\tthis.setSearchFlag = function( filter ) {\n\t\t\tvar basic_tab = this.find( 'a[href=\\'#basic_search\\']' );\n\t\t\tvar adv_tab = this.find( 'a[href=\\'#adv_search\\']' );\n\n\t\t\tbasic_tab.removeClass( 'active-label' );\n\t\t\tadv_tab.removeClass( 'active-label' );\n\n\t\t\tvar hasFilter = false;\n\t\t\tfor ( var key in filter ) {\n\t\t\t\tif ( key === 'country' && filter[key].value == TTUUID.not_exist_id ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t//For Documents view\n\t\t\t\tif ( $.inArray( key, ['private', 'template','is_attachment' ] ) !== -1 && filter[key].value == false ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// For Authorizations views\n\t\t\t\tif ( key === 'hierarchy_level' && ( filter[key].value == 1 || filter[key].value.value == 1 ) ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\thasFilter = true;\n\t\t\t}\n\n\t\t\tif ( hasFilter ) {\n\t\t\t\t$( this ).find( '.search-flag' ).remove();\n\t\t\t\tif ( select_tab_index === 0 || hidedAdvTab ) {\n\t\t\t\t\tbasic_tab.addClass( 'active-label' );\n\t\t\t\t\tbasic_tab.html( $.i18n._( 'BASIC SEARCH' ) + '<img title=\\'' + $.i18n._( 'Search is currently active' ) + '\\' src=\\'' + Global.getRealImagePath( 'css/global/widgets/ribbon/icons/alert-16x16.png' ) + '\\' class=\\'search-flag\\'> </img>' );\n\t\t\t\t} else {\n\t\t\t\t\tadv_tab.addClass( 'active-label' );\n\t\t\t\t\tadv_tab.html( $.i18n._( 'ADVANCED SEARCH' ) + '<img title=\\'' + $.i18n._( 'Search is currently active' ) + '\\' src=\\'' + Global.getRealImagePath( 'css/global/widgets/ribbon/icons/alert-16x16.png' ) + '\\' class=\\'search-flag\\'> </img>' );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$( this ).find( '.search-flag' ).remove();\n\t\t\t}\n\n\t\t};\n\n\t\t//Don't trgiiger tab event in some case. Like first set filter to search panel\n\t\tthis.setSelectTabIndex = function( val, triggerEvent ) {\n\n\t\t\tif ( select_tab_index === val ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( Global.isSet( triggerEvent ) ) {\n\t\t\t\ttrigger_change_event = triggerEvent;\n\t\t\t} else {\n\t\t\t\ttrigger_change_event = true;\n\t\t\t}\n\n\t\t\t$( tab ).tabs( 'option', 'active', val );\n\t\t};\n\n\t\tthis.getLastSelectTabIndex = function() {\n\t\t\treturn last_select_tab_index;\n\t\t};\n\n\t\tthis.getLastSelectTabId = function() {\n\n\t\t\tif ( !last_select_tab ) {\n\t\t\t\treturn 'basic_search';\n\t\t\t}\n\n\t\t\treturn $( last_select_tab.tab ).attr( 'ref' );\n\t\t};\n\n\t\tthis.getSelectTabIndex = function() {\n\t\t\treturn select_tab_index;\n\t\t};\n\n\t\tthis.getLayoutsArray = function() {\n\t\t\treturn layouts_array;\n\t\t};\n\n\t\tfunction setGridSize() {\n\t\t\tif ( related_view_controller.grid ) {\n\t\t\t\trelated_view_controller.setGridSize();\n\t\t\t\trelated_view_controller.setGridColumnsWidth();\n\n\t\t\t\tif ( related_view_controller.column_selector ) { //This doesn't exist on Attendance -> TimeSheet, Basic Search. JS exception: TypeError: related_view_controller.column_selector is null\n\t\t\t\t\trelated_view_controll
|