1 line
40 KiB
JavaScript
1 line
40 KiB
JavaScript
|
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-find_available-FindAvailableViewController"],{2921:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FindAvailableViewController\": () => (/* binding */ FindAvailableViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass FindAvailableViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#find_available_view_container',\n\t\t\tstatus_array: null,\n\t\t\tsex_array: null,\n\t\t\tuser_group_array: null,\n\t\t\tcountry_array: null,\n\t\t\tprovince_array: null,\n\n\t\t\tcompany_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.permission_id = 'user';\n\t\tthis.viewId = 'FindAvailable';\n\t\tthis.script_name = 'PopUpEmployeeView';\n\n\t\tthis.api = TTAPI.APIScheduleAdvanced;\n\t\tthis.company_api = TTAPI.APICompany;\n\n\t\t$( this.el ).css( 'opacity', 0 );\n\t\tthis.render();\n\n\t\tthis.initData();\n\t}\n\n\t//No right click menu for this\n\tinitRightClickMenu( target_type ) {\n\t\treturn;\n\t}\n\n\tshowNoResultCover( show_new_btn ) {\n\t\tsuper.showNoResultCover( false );\n\t}\n\n\tsetGridSize() {\n\t\tvar $this = this;\n\n\t\tthis.grid.setGridWidth( $( this.el ).width() );\n\t\tthis.grid.setGridColumnsWidth();\n\t\tthis.grid.setGridHeight( this.getAvailableHeightForGrid( this.el ) );\n\n\t\t$( window ).off( 'resize.find_available_grid' ).on( 'resize.find_available_grid', function() {\n\t\t\tif ( $( $this.el ) ) {\n\t\t\t\t$this.grid.setGridWidth( $( $this.el ).width() );\n\t\t\t\t$this.grid.setGridColumnsWidth();\n\t\t\t\t$this.grid.setGridHeight( $this.getAvailableHeightForGrid( $this.el ) );\n\t\t\t}\n\t\t} );\n\t}\n\n\tsearch( set_default_menu, page_action, page_number ) {\n\n\t\tthis.setGridSize();\n\t\tif ( !Global.isSet( set_default_menu ) ) {\n\t\t\tset_default_menu = true;\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_sort = {};\n\t\tfilter.filter_columns = this.getFilterColumnsFromDisplayColumns();\n\t\tfilter.filter_items_per_page = 0; // Default to 0 to load user preference defined\n\n\t\tif ( this.pager_data ) {\n\n\t\t\tif ( LocalCacheData.paging_type === 0 ) {\n\t\t\t\tif ( page_action === 'next' ) {\n\t\t\t\t\tfilter.filter_page = this.pager_data.next_page;\n\t\t\t\t} else {\n\t\t\t\t\tfilter.filter_page = 1;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\tswitch ( page_action ) {\n\t\t\t\t\tcase 'next':\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.next_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'last':\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.previous_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'start':\n\t\t\t\t\t\tfilter.filter_page = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.last_page_number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'go_to':\n\t\t\t\t\t\tfilter.filter_page = page_number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.current_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\tfilter.filter_page = 1;\n\t\t}\n\n\t\tif ( this.sub_view_mode && this.parent_key ) {\n\t\t\tthis.select_layout.data.filter_data[this.parent_key] = this.parent_value;\n\t\t}\n\t\t//If sub view controller set custom filters, get it\n\t\tif ( Global.isSet( this.getSubViewFilter ) ) {\n\n\t\t\tthis.select_layout.data.filter_data = this.getSubViewFilter( this.select_layout.data.filter_data );\n\n\t\t}\n\n\t\t//select_layout will not be null, it's set in setSelectLayout function\n\n\t\tfilter.filter_data = Global.convertLayoutFilterToAPIFilter( this.select_layout );\n\t\tfilter.filter_sort = this.select_layout.data.filter_sort;\n\n\t\tif ( TTUUID.isUUID( this.re
|