"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["reports-ReportBaseViewController"],{7867:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ReportBaseViewController\": () => (/* binding */ ReportBaseViewController)\n/* harmony export */ });\n/* harmony import */ var _views_BaseViewController__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(121);\n/* harmony import */ var _global_Global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(9490);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\n\nclass ReportBaseViewController extends _views_BaseViewController__WEBPACK_IMPORTED_MODULE_0__.BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tview_file: '',\n\n\t\t\tpage_orientation_array: null,\n\t\t\tfont_size_array: null,\n\t\t\tauto_refresh_array: null,\n\t\t\tchart_display_mode_array: null,\n\t\t\tchart_type_array: null,\n\t\t\ttemplates_array: null,\n\t\t\tsetup_fields_array: null,\n\n\t\t\tlog_action_id_array: null,\n\n\t\t\tlog_table_name_id_array: null,\n\n\t\t\ttime_period_array: null,\n\n\t\t\tvisible_report_widgets: null,\n\n\t\t\tvisible_report_values: null,\n\n\t\t\tvisible_report_widgets_order_fix: null,\n\n\t\t\tstatus_id_array: null,\n\n\t\t\tapi_user_report: null,\n\n\t\t\tcurrent_saved_report: null, // Current saved report if any\n\n\t\t\tsaved_report_array: null,\n\n\t\t\tsub_saved_report_view_controller: null,\n\n\t\t\tsub_custom_column_view_controller: null,\n\n\t\t\tneed_refresh_display_columns: false, //When custom column changed. Set this to true.\n\n\t\t\tReportMissedField: null,\n\n\t\t\tinclude_form_setup: false,\n\n\t\t\tshow_empty_message: false,\n\n\t\t\tdo_validate_after_create_ui: false, //Do validate if there is a saved report\n\n\t\t\tform_setup_changed: false\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tpreInit( options ) {\n\t\tthis.preInitReport();\n\t}\n\n\tinit( options ) {\n\t\t//Initialize this.real_this without having to call _super,\n\t\t//this avoids Maximum stack size errors in other functions that call _super. Copied from __super.\n\t\tthis.real_this = this.constructor.__super__;\n\n\t\tthis.permission_id = 'report';\n\n\t\tLocalCacheData.current_open_report_controller = this;\n\n\t\tvar $this = this;\n\n\t\t$this.api_user_report = TTAPI.APIUserReportData;\n\t\t$this.initReport();\n\t\t// this.buildContextMenu(); // #VueContextMenu#EditOnly - Commented out as must happen after initEditViewUI\n\t\tTTPromise.resolve( 'Reports', 'openReport' );\n\t\t$this.postInitReport();\n\t}\n\n\t// Removed because the require callback in init() serves this function and calls postInitReport() at the proper time.\n\t// postInit: function(){\n\t// },\n\n\tpreInitReport( options ) {\n\t}\n\n\tinitReport( options ) {\n\t}\n\n\tpostInitReport( options ) {\n\t}\n\n\trender() {\n\t}\n\n\t// Need always override if report has filter field.\n\tprocessFilterField() {\n\t}\n\n\tgetDefaultReport( data ) {\n\t\tvar item = _.find( data, function( item ) {\n\t\t\treturn item.is_default === true;\n\t\t} );\n\t\tdata && data.length > 0 && !item && ( item = data[0] );\n\n\t\treturn item;\n\t}\n\n\t// overrides BaseViewController.getDefaultContextMenuModel()\n\tgetDefaultContextMenuModel() {\n\n\t\tvar default_context_menu_model = {\n\t\t\t// only put groups that are used in default here, others go in the relevant view controller to avoid confusion on which are obsolete.\n\t\t\tgroups: {\n\t\t\t\teditor: {\n\t\t\t\t\tlabel: $.i18n._( 'Editor' ),\n\t\t\t\t\tid: 'editor'\n\t\t\t\t},\n\t\t\t\tsaved_report: {\n\t\t\t\t\tlabel: $.i18n._( 'Saved Report' ),\n\t\t\t\t\tid: this.viewId + 'SavedReport'\n\t\t\t\t}\n\t\t\t},\n\n\t\t\t'icons': {}\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['view_html'] = {\n\t\t\tlabel: $.i18n._( 'View' ),\n\t\t\tid: 'view_html',\n\t\t\taction_group: 'view',\n\t\t\tgroup: 'editor',\n\t\t\tvue_icon: 'tticon tticon-visibility_black_24dp',\n\t\t\tshow_on_right_click: true,\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['view'] = {\n\t\t\tlabel: $.i18n._( 'PDF' ),\n\t\t\tid: 'view',\n\t\t\taction_group: 'view',\n\t\t\tgroup: 'editor',\n\t\t\tvue_icon: 'tticon tticon-picture_as_pdf_black_24dp',\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['export_excel'] = {\n\t\t\tlabel: $.i18n._( 'Excel' ),\n\t\t\tid: 'export_excel',\n\t\t\taction_group: 'view',\n\t\t\tgroup: 'editor',\n\t\t\tvue_icon: 'tticon tticon-file_upload_black_24dp',\n\t\t\tsort_order: 1800\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['cancel'] = {\n\t\t\tlabel: $.i18n._( 'Cancel' ),\n\t\t\tid: 'cancel',\n\t\t\tgroup: 'editor',\n\t\t\tvue_icon: 'tticon tticon-cancel_black_24dp',\n\t\t\tsort_order: 1990\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['save_existed_report'] = {\n\t\t\tlabel: $.i18n._( 'Save' ),\n\t\t\tid: 'save_existed_report',\n\t\t\taction_group: 'save',\n\t\t\tgroup: 'saved_report',\n\t\t\tvue_icon: 'tticon tticon-save_black_24dp',\n\t\t\tshow_on_right_click: true,\n\t\t};\n\n\t\tdefault_context_menu_model['icons']['save_new_report'] = {\n\t\t\tlabel: $.i18n._( 'Save as New' ),\n\t\t\tid: 'save_new_report',\n\t\t\taction_group: 'save',\n\t\t\tgroup: 'saved_report',\n\t\t\tvue_icon: 'tticon tticon-save_black_24dp',\n\t\t};\n\n\t\treturn default_context_menu_model;\n\t}\n\n\t//this prevents the function of the same name in base class from hiding all of the export to excel buttons on all reports due to their lack of a grid.\n\tsetDefaultMenuExportIcon( context_btn, grid_selected_length, pId ) {\n\t}\n\n\topenEditView() {\n\t\tvar $this = this;\n\t\tthis.initOptions( function() {\n\t\t\t// Always need override\n\t\t\t$this.processFilterField();\n\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t$this.initEditViewUI( $this.viewId, $this.view_file );\n\t\t\t\t$this.buildContextMenu(); // #VueContextMenu#EditOnly - Must happen after initEditViewUI\n\t\t\t\t$this.setEditMenu(); // Since moving buildContextMenu to being after initEditViewUI, none of the report icons were enabled until a tab was switched. So adding this in here refreshes the icons.\n\t\t\t}\n\n\t\t\t$this.do_validate_after_create_ui = true;\n\n\t\t\tTTPromise.wait( 'init', 'init', function() {\n\t\t\t\tif ( LocalCacheData.default_edit_id_for_next_open_edit_view ) {\n\t\t\t\t\t$this.navigation.setValue( LocalCacheData.default_edit_id_for_next_open_edit_view );\n\t\t\t\t\t$this.api_user_report.getUserReportData( { filter_data: { id: LocalCacheData.default_edit_id_for_next_open_edit_view } }, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tresult = result.getResult();\n\t\t\t\t\t\t\t$this.current_saved_report = result[0];\n\t\t\t\t\t\t\t$this.current_edit_record = {};\n\t\t\t\t\t\t\t$this.visible_report_values = {};\n\t\t\t\t\t\t\tLocalCacheData.default_edit_id_for_next_open_edit_view = null;\n\t\t\t\t\t\t\t$this.initEditView();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\t\t\t\t\t$this.api_user_report.getUserReportData( {\n\t\t\t\t\t\tfilter_data: {\n\t\t\t\t\t\t\tscript: $this.script_name,\n\t\t\t\t\t\t\tis_default: true\n\t\t\t\t\t\t}\n\t\t\t\t\t}, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tvar data = result.getResult();\n\t\t\t\t\t\t\t$this.current_saved_report = {};\n\t\t\t\t\t\t\tif ( data && data.length > 0 ) {\n\t\t\t\t\t\t\t\t$this.current_saved_report = data[0];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$this.current_edit_record = {};\n\t\t\t\t\t\t\t$this.visible_report_values = {};\n\t\t\t\t\t\t\t$this.initEditView();\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t} );\n\t\t} );\n\t}\n\n\t// #2838 Commenting this out, as it was only needed for ReportView.vue. Basically a revert of 44b853d92b9b45b58aa2c1723537fb408afffe8f\n\t// Currently we are going to go back to the old existing logic of loading each report html, and keeping the contextmenu in the old place, as the Vue template had too many bugs for now, and does not take into account form_setup and custom colummns etc.\n\t// Future work can re-include this when we consolidate the html templates into Vue templates.\n\t// initEditViewUI( view_id, edit_view_file_name ) {\n\t// \tGlobal.setUINotready();\n\t// \tTTPromise.add( 'init', 'init' );\n\t// \tTTPromise.wait();\n\t//\n\t// \tvar $this = this;\n\t// \tif ( this.edit_view ) {\n\t// \t\tthis.edit_view.remove();\n\t// \t}\n\t//\n\t// \t// this.edit_view = $( Global.loadViewSource( view_id, edit_view_file_name, null, true ) );\n\t// \tthis.edit_view = Global.contentContainer().find('.report-view.edit-view');\n\t//\n\t// \t//#2353 - commented out because it breaks subgrid menus in the employee qualifications tab\n\t// \t//calls the context menu click every time that the edit view is clicked.\n\t// \t// this.edit_view.unbind( 'click' ).bind( 'click', function() {\n\t// \t// \t$this.selectContextMenu();\n\t// \t// } );\n\t//\n\t// \tthis.edit_view_tab = $( this.edit_view.find( '.edit-view-tab-bar' ) );\n\t// \tthis.edit_view_tab.css( 'opacity', 0 );\n\t//\n\t// \t//Give edt view tab a id, so we can load it when put right click menu on it\n\t// \tthis.edit_view_tab.attr( 'id', this.ui_id + '_edit_view_tab' );\n\t//\n\t// \tthis.setTabOVisibility( false );\n\t//\n\t// \tthis.edit_view_tab = this.edit_view_tab.tabs( {\n\t// \t\tactivate: function( e, ui ) {\n\t// \t\t\tif ( !$this.edit_view_tab || !$this.edit_view_tab.is( ':visible' ) ) {\n\t// \t\t\t\treturn;\n\t// \t\t\t}\n\t//\n\t// \t\t\t$this.onTabShow( e, ui );\n\t// \t\t\tGlobal.triggerAnalyticsTabs( e, ui );\n\t// \t\t}\n\t// \t} );\n\t//\n\t// \tthis.edit_view_tab.off( 'click' ).on( 'click', function( e ) {\n\t// \t\t$this.onTabIndexChange( e );\n\t// \t} );\n\t//\n\t// \t// Global.contentContainer().append( this.edit_view );\n\t//\n\t// \tthis.initRightClickMenu( RightClickMenuType.EDITVIEW );\n\t//\n\t// \tthis.buildEditViewUI();\n\t//\n\t// \t$this.setEditViewTabHeight();\n\t// \tTTPromise.wait( 'init', 'init', function() {\n\t// \t\t$this.edit_view.css( 'opacity', 1 ); // To prevent a FOUC from empty form to populated.\n\t// \t\t$( '.edit-view-tab-bar' ).css( 'opacity', 1 );\n\t// \t} );\n\t// }\n\n\tsetDefaultConfigData() {\n\n\t\tvar $this = this;\n\t\tthis.api.getOtherConfig( {\n\t\t\tonResult: function( config_result ) {\n\n\t\t\t\tif ( $this.current_saved_report &&\n\t\t\t\t\t$this.current_saved_report.data &&\n\t\t\t\t\t$this.current_saved_report.data.config &&\n\t\t\t\t\t$this.current_saved_report.data.config.other\n\t\t\t\t) {\n\t\t\t\t\t//do nothing\n\t\t\t\t} else {\n\n\t\t\t\t\tconfig_result = config_result.getResult();\n\t\t\t\t\tfor ( var key in config_result ) {\n\t\t\t\t\t\tif ( $this.edit_view_ui_dic.hasOwnProperty( key ) ) {\n\t\t\t\t\t\t\t$this.edit_view_ui_dic[key].setValue( config_result[key] );\n\t\t\t\t\t\t\t$this.current_edit_record[key] = config_result[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\n\t\tthis.api.getChartConfig( {\n\t\t\tonResult: function( config_result ) {\n\n\t\t\t\tif ( $this.current_saved_report &&\n\t\t\t\t\t$this.current_saved_report.data &&\n\t\t\t\t\t$this.current_saved_report.data.config &&\n\t\t\t\t\t$this.current_saved_report.data.config.chart\n\t\t\t\t) {\n\t\t\t\t\t//do nothing\n\t\t\t\t} else {\n\n\t\t\t\t\tconfig_result = config_result.getResult();\n\t\t\t\t\tfor ( var key in config_result ) {\n\t\t\t\t\t\tif ( $this.edit_view_ui_dic.hasOwnProperty( key ) ) {\n\t\t\t\t\t\t\t$this.edit_view_ui_dic[key].setValue( config_result[key] );\n\t\t\t\t\t\t\t$this.current_edit_record[key] = config_result[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetTabStatus() {\n\t\t//Handle most cases that one tab and on audit tab\n\t}\n\n\t//Call this from setEditViewData\n\tinitTabData() {\n\t}\n\n\tgetReportData( callBack ) {\n\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.filter_data = { script: this.script_name };\n\t\tthis.api_user_report.getUserReportData( args, {\n\t\t\tonResult: function( result ) {\n\n\t\t\t\tvar res_data = result.getResult();\n\t\t\t\t$this.pager_data = result.getPagerData();\n\n\t\t\t\tcallBack( res_data );\n\t\t\t}\n\t\t} );\n\t}\n\n\tinitOptions( callBack ) {\n\t\tvar options = [\n\t\t\t{ option_name: 'page_orientation' },\n\t\t\t{ option_name: 'font_size' },\n\t\t\t{ option_name: 'auto_refresh' },\n\t\t\t{ option_name: 'chart_display_mode' },\n\t\t\t{ option_name: 'chart_type' },\n\t\t\t{ option_name: 'templates' },\n\t\t\t{ option_name: 'setup_fields' }\n\n\t\t];\n\n\t\tthis.initDropDownOptions( options, function( result ) {\n\t\t\tcallBack( result ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t} );\n\t}\n\n\t//Call this from setEditViewData\n\tinitEditViewData() {\n\t\tvar $this = this;\n\n\t\t//Set Navigation Awesomebox\n\t\tvar navigation_div = this.edit_view.find( '.navigation-div' );\n\t\tnavigation_div.css( 'display', 'block' );\n\n\t\t//init navigation only when open edit view\n\t\tif ( !this.navigation.getSourceData() ) {\n\t\t\tthis.navigation.setSourceData( this.saved_report_array );\n\t\t\tif ( LocalCacheData.getLoginUserPreference() ) {\n\t\t\t\tthis.navigation.setRowPerPage( LocalCacheData.getLoginUserPreference().items_per_page );\n\t\t\t}\n\t\t\tthis.navigation.setPagerData( this.pager_data );\n\n\t\t\tvar default_args = {};\n\t\t\tdefault_args.filter_data = { script: this.script_name };\n\t\t\tthis.navigation.setDefaultArgs( default_args );\n\t\t}\n\n\t\tthis.navigation.setValue( this.current_saved_report );\n\t\tthis.setUIWidgetFieldsToCurrentEditRecord();\n\t\tthis.setNavigationArrowsEnabled();\n\t\t// Create this function alone because of the column value of view is different from each other, some columns need to be handle specially. and easily to rewrite this function in sub-class.\n\t\tthis.setCurrentEditRecordData();\n\n\t\t//Can't hide navigation box if there aren't any saved reports, without having to make an API call and count how many saved reports there are first, which kind of defeats the purpose.\n\n\t\t//Init *Please save this record before modifying any related data* box\n\t\tthis.edit_view.find( '.save-and-continue-div' ).SaveAndContinueBox( { related_view_controller: this } );\n\t\tthis.edit_view.find( '.save-and-continue-div' ).css( 'display', 'none' );\n\t}\n\n\tonRightOrLeftArrowClickCallBack( next_select_item ) {\n\t\tthis.navigation.setValue( next_select_item );\n\t\tthis.current_saved_report = next_select_item;\n\t\tthis.current_edit_record = {};\n\t\tthis.visible_report_values = {};\n\t\tthis.initEditView();\n\t}\n\n\t//Call this after initEditViewUI, usually after current_edit_record is set\n\tinitEditView() {\n\t\tvar $this = this;\n\t\tvar current_url = window.location.href;\n\t\tif ( current_url.indexOf( '&sm' ) > 0 ) {\n\t\t\tcurrent_url = current_url.substring( 0, current_url.indexOf( '&sm' ) );\n\t\t}\n\t\tif ( $this.current_saved_report && $this.current_saved_report.id ) {\n\n\t\t\tcurrent_url = current_url + '&sm=' + $this.viewId + '&sid=' + $this.current_saved_report.id;\n\n\t\t} else {\n\t\t\tcurrent_url = current_url + '&sm=' + $this.viewId;\n\t\t}\n\n\t\tif ( window.location.href.indexOf( '&tab=' ) > 0 ) {\n\t\t\tvar tab_name = window.location.href;\n\t\t\ttab_name = tab_name.substr( ( window.location.href.indexOf( '&tab=' ) + 5 ) ); //get the selected tab name\n\t\t\ttab_name = tab_name.substr( 0, window.location.href.indexOf( '&' ) ); // incase there are subsequent arguments after the tab argument\n\t\t\tcurrent_url += '&tab=' + tab_name;\n\t\t}\n\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.setURLToBrowser */ .x.setURLToBrowser( current_url );\n\n\t\tsuper.initEditView();\n\t}\n\n\tsetNavigation() {\n\n\t\tvar $this = this;\n\n\t\tthis.navigation.off( 'formItemChange' ).on( 'formItemChange', function( e, target ) {\n\t\t\tvar next_select_item_id = target.getValue();\n\t\t\t$this.edit_view_error_ui_dic = {};\n\t\t\tif ( !next_select_item_id || next_select_item_id === TTUUID.zero_id ) {\n\t\t\t\t$this.current_saved_report = null;\n\t\t\t\t$this.saved_report_array = [];\n\t\t\t\t$this.current_edit_record = {};\n\t\t\t\t$this.visible_report_values = {};\n\n\t\t\t\t$this.do_validate_after_create_ui = true;\n\t\t\t\t$this.initEditView();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( next_select_item_id !== $this.current_edit_record.id ) {\n\t\t\t\t$this.current_saved_report = target.getValue( true );\n\t\t\t\t$this.current_edit_record = {};\n\t\t\t\t$this.visible_report_values = {};\n\n\t\t\t\t$this.initEditView();\n\t\t\t}\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.triggerAnalyticsEditViewNavigation */ .x.triggerAnalyticsEditViewNavigation( 'navigation', $this.viewId );\n\t\t} );\n\t}\n\n\tinitSubCustomColumnView( callBack ) {\n\t\tvar $this = this;\n\n\t\t$this.sub_view_mode = true;\n\n\t\tif ( this.sub_custom_column_view_controller ) {\n\t\t\t$this.sub_custom_column_view_controller.edit_only_mode = false;\n\t\t\t$this.sub_custom_column_view_controller.buildContextMenu( true );\n\t\t\t$this.sub_custom_column_view_controller.parent_value = this.script_name;\n\t\t\t$this.sub_custom_column_view_controller.initData(); //Init data in this parent view\n\t\t\treturn;\n\t\t}\n\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadViewSource */ .x.loadViewSource( 'CustomColumn', 'CustomColumnViewController.js', function() {\n\t\t\tvar tab = $this.edit_view_tab.find( '#tab_custom_columns' );\n\n\t\t\tvar firstColumn = tab.find( '.first-column-sub-view' );\n\n\t\t\tTTPromise.add( 'SubCustomColumnView', 'init' );\n\t\t\tTTPromise.wait( 'SubCustomColumnView', 'init', function() {\n\t\t\t\tfirstColumn.css( 'opacity', '1' );\n\t\t\t} );\n\n\t\t\tfirstColumn.css( 'opacity', '0' ); //Hide the grid while its loading/sizing.\n\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.trackView */ .x.trackView( 'Sub' + 'ReportSchedule' + 'View' );\n\t\t\tCustomColumnViewController.loadSubView( firstColumn, beforeLoadView, afterLoadView );\n\n\t\t} );\n\n\t\tfunction beforeLoadView() {\n\n\t\t}\n\n\t\tfunction afterLoadView( subViewController ) {\n\t\t\t$this.sub_custom_column_view_controller = subViewController;\n\t\t\t$this.sub_custom_column_view_controller.parent_key = 'script';\n\t\t\t$this.sub_custom_column_view_controller.parent_value = $this.script_name;\n\t\t\t$this.sub_custom_column_view_controller.parent_view_controller = $this;\n\t\t\t$this.sub_custom_column_view_controller.edit_only_mode = false;\n\t\t\t$this.sub_custom_column_view_controller.sub_view_mode = true;\n\n\t\t\t//init complete\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack(); // Call back decide call init or not\n\t\t\t}\n\t\t\t$this.sub_custom_column_view_controller.initData(); //Init data in this parent view\n\t\t}\n\t}\n\n\tonSavedReportDelete() {\n\t\tthis.refreshNav();\n\t}\n\n\tinitSubSavedReportView( callBack ) {\n\t\tvar $this = this;\n\n\t\t$this.sub_view_mode = true;\n\n\t\tif ( this.sub_saved_report_view_controller ) {\n\t\t\t$this.sub_saved_report_view_controller.edit_only_mode = false;\n\t\t\t$this.sub_saved_report_view_controller.buildContextMenu( true );\n\t\t\t$this.sub_saved_report_view_controller.parent_value = this.script_name;\n\t\t\t$this.sub_saved_report_view_controller.initData(); //Init data in this parent view\n\t\t\treturn;\n\t\t}\n\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadViewSource */ .x.loadViewSource( 'SavedReport', 'SavedReportViewController.js', function() {\n\t\t\tvar tab = $this.edit_view_tab.find( '#tab_saved_reports' );\n\n\t\t\tvar firstColumn = tab.find( '.first-column-sub-view' );\n\n\t\t\tTTPromise.add( 'SubSavedReportView', 'init' );\n\t\t\tTTPromise.wait( 'SubSavedReportView', 'init', function() {\n\t\t\t\tfirstColumn.css( 'opacity', '1' );\n\t\t\t} );\n\n\t\t\tfirstColumn.css( 'opacity', '0' ); //Hide the grid while its loading/sizing.\n\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.trackView */ .x.trackView( 'Sub' + 'ReportSchedule' + 'View' );\n\t\t\tSavedReportViewController.loadSubView( firstColumn, beforeLoadView, afterLoadView );\n\n\t\t} );\n\n\t\tfunction beforeLoadView() {\n\n\t\t}\n\n\t\tfunction afterLoadView( subViewController ) {\n\n\t\t\t$this.sub_saved_report_view_controller = subViewController;\n\t\t\t$this.sub_saved_report_view_controller.parent_key = 'script';\n\t\t\t$this.sub_saved_report_view_controller.parent_value = $this.script_name;\n\t\t\t$this.sub_saved_report_view_controller.parent_view_controller = $this;\n\t\t\t$this.sub_saved_report_view_controller.edit_only_mode = false;\n\t\t\t$this.sub_saved_report_view_controller.sub_view_mode = true;\n\n\t\t\t//init complete\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack(); // Call back decide call init or not\n\t\t\t} else {\n\t\t\t\t$this.sub_saved_report_view_controller.initData(); //Init data in this parent view\n\t\t\t}\n\t\t}\n\t}\n\n\tbuildEditViewUI() {\n\t\tvar $this = this;\n\n\t\tthis.initEditViewTabs(); // Fixes: Report tabs not initializing in reports, as this code was moved around in BaseVC to initEditViewTabs, which never gets called in Reports because setTabModel() is not used in Reports, which calls this. See 766392fed39460764542611f3ab4df1deb518cf1\n\n\t\tvar navigation_div = this.edit_view.find( '.navigation-div' );\n\t\tvar label = navigation_div.find( '.navigation-label' );\n\t\tvar left_click = navigation_div.find( '.left-click' );\n\t\tvar right_click = navigation_div.find( '.right-click' );\n\t\tvar navigation_widget_div = navigation_div.find( '.navigation-widget-div' );\n\t\tthis.initNavigationWidget( navigation_widget_div );\n\t\tleft_click.attr( 'src', _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getRealImagePath */ .x.getRealImagePath( 'images/left_arrow.svg' ) );\n\t\tright_click.attr( 'src', _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getRealImagePath */ .x.getRealImagePath( 'images/right_arrow.svg' ) );\n\t\tlabel.text( this.navigation_label );\n\n\t\tthis.edit_view_close_icon = this.edit_view.find( '.close-icon' );\n\t\tthis.edit_view_close_icon.hide();\n\t\tthis.edit_view_close_icon.click( function() {\n\t\t\t$this.onCloseIconClick();\n\t\t} );\n\n\t\tvar tab_0_label = this.edit_view.find( 'a[ref=tab_report]' );\n\t\tvar tab_1_label = this.edit_view.find( 'a[ref=tab_setup]' );\n\t\tvar tab_2_label = this.edit_view.find( 'a[ref=tab_chart]' );\n\n\t\tif ( this.include_form_setup ) {\n\t\t\t// TODO: #2838 BIG todo here for when we convert back to ReportView.vue, as that does not handle the form setup field yet in the all-in-one template.\n\t\t\tvar tab_3_label = this.edit_view.find( 'a[ref=tab_form_setup]' );\n\t\t\tvar tab_4_label = this.edit_view.find( 'a[ref=tab_custom_columns]' );\n\t\t\tvar tab_5_label = this.edit_view.find( 'a[ref=tab_saved_reports]' );\n\n\t\t\ttab_0_label.text( $.i18n._( 'Report' ) );\n\t\t\ttab_1_label.text( $.i18n._( 'Setup' ) );\n\t\t\ttab_2_label.text( $.i18n._( 'Chart' ) );\n\t\t\ttab_3_label.text( $.i18n._( 'Form Setup' ) );\n\t\t\ttab_4_label.text( $.i18n._( 'Custom Columns' ) );\n\t\t\ttab_5_label.text( $.i18n._( 'Saved Reports' ) );\n\n\t\t\tthis.buildFormSetupUI();\n\t\t} else {\n\t\t\tvar tab_3_label = this.edit_view.find( 'a[ref=tab_custom_columns]' );\n\t\t\tvar tab_4_label = this.edit_view.find( 'a[ref=tab_saved_reports]' );\n\n\t\t\ttab_0_label.text( $.i18n._( 'Report' ) );\n\t\t\ttab_1_label.text( $.i18n._( 'Setup' ) );\n\t\t\ttab_2_label.text( $.i18n._( 'Chart' ) );\n\t\t\ttab_3_label.text( $.i18n._( 'Custom Columns' ) );\n\t\t\ttab_4_label.text( $.i18n._( 'Saved Reports' ) );\n\t\t}\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUserReportData,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user_report_data',\n\t\t\tdefault_args: { filter_data: { script: this.script_name } },\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true, //Required in case there are saved reports but none of them are the default.\n\t\t\talways_search_full_columns: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Making sure that this.saved_report_array is not empty, otherwise navigation arrows will not be enabled on first opening even if there are other reports.\n\t\tif ( this.saved_report_array == null ) {\n\t\t\tthis.navigation.setSourceData( null );\n\t\t\t$this.getReportData( function( result ) {\n\t\t\t\tif ( result && result.length > 0 ) {\n\t\t\t\t\t$this.saved_report_array = result;\n\t\t\t\t} else {\n\t\t\t\t\t$this.saved_report_array = [];\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\t//Tab 0 start\n\n\t\tvar tab_report = this.edit_view_tab.find( '#tab_report' );\n\n\t\tvar tab0_column1 = tab_report.find( '.first-column' );\n\n\t\t// Template\n\t\tvar form_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'template', set_empty: true } );\n\t\tform_item_input.setSourceData( $this.templates_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Template' ), form_item_input, tab0_column1 );\n\n\t\t//Tab 1 start\n\t\tvar tab_setup = this.edit_view_tab.find( '#tab_setup' );\n\t\tvar tab1_column1 = tab_setup.find( '.first-column' );\n\n\t\t//Fields\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tallow_multiple_selection: true,\n\t\t\tkey: 'value',\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tallow_drag_to_order: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'setup_field'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Fields' ), form_item_input, tab1_column1, '' );\n\t\tthis.setup_fields_array.shift();\n\t\tform_item_input.setSourceData( this.setup_fields_array );\n\n\t\t//Page Orientation\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'page_orientation', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.page_orientation_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Page Orientation' ), form_item_input, tab1_column1 );\n\n\t\t//Font Size\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'font_size', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.font_size_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Font Size' ), form_item_input, tab1_column1 );\n\n\t\t//Disable Grand Total\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'disable_grand_total' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Disable Grand Total' ), form_item_input, tab1_column1 );\n\n\t\t//Show Duplicate Values\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'show_duplicate_values' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Show Duplicate Values' ), form_item_input, tab1_column1 );\n\n\t\t//Auto-Refresh\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'auto_refresh', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.auto_refresh_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Auto-Refresh' ), form_item_input, tab1_column1 );\n\n\t\t//Maximum Pages\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'maximum_page_limit', width: 50 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Maximum Pages' ), form_item_input, tab1_column1 );\n\n\t\t//Tab 2 start\n\t\tvar tab_chart = this.edit_view_tab.find( '#tab_chart' );\n\t\tvar tab2_column1 = tab_chart.find( '.first-column' );\n\n\t\t//Enable\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'enable' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Enable' ), form_item_input, tab2_column1, '' );\n\n\t\t//Display\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'display_mode', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.chart_display_mode_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Display' ), form_item_input, tab2_column1 );\n\n\t\t//Type\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'type', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.chart_type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab2_column1 );\n\n\t\t//Chart Sub-Totals\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'include_sub_total' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Chart Sub-Totals' ), form_item_input, tab2_column1 );\n\n\t\t//Consistent Axis Scales\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'axis_scale_static' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Consistent Axis Scales' ), form_item_input, tab2_column1 );\n\n\t\t//Consistent Axis Scales\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\tform_item_input.TCheckbox( { field: 'combine_columns' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Combine Columns' ), form_item_input, tab2_column1, '' );\n\n\t\tTTPromise.resolve( 'init', 'init' );\n\t}\n\n\tbuildFormSetupUI() {\n\t\t//Need always override\n\t}\n\n\tbuildSelectTemplateData() {\n\t\tvar template = this.current_saved_report.data.template;\n\t\tvar config = this.current_saved_report.data.config;\n\n\t\tvar result = {};\n\n\t\tfor ( var i = 0; i < template.length; i++ ) {\n\t\t\tvar item = template[i];\n\t\t\tif ( item === 'sort' ) {\n\t\t\t\tresult[item] = config[item + '_'];\n\t\t\t} else {\n\t\t\t\tresult[item] = config[item];\n\t\t\t}\n\n\t\t}\n\n\t\treturn result;\n\t}\n\n\t/* jshint ignore:start */\n\tsetCurrentEditRecordData() {\n\n\t\tvar $this = this;\n\t\tif ( LocalCacheData.default_filter_for_next_open_view ) {\n\n\t\t\tthis.do_validate_after_create_ui = false;\n\t\t\tthis.current_edit_record['template'] = LocalCacheData.default_filter_for_next_open_view.template;\n\t\t\t$this.onTemplateChange( this.current_edit_record['template'] );\n\t\t\tLocalCacheData.default_filter_for_next_open_view = null;\n\n\t\t} else {\n\t\t\tif ( this.current_saved_report && this.current_saved_report.data ) {\n\t\t\t\tvar select_template_data = this.buildSelectTemplateData();\n\t\t\t\tthis.setSelectTemplate( select_template_data );\n\n\t\t\t\tthis.current_edit_record['template'] = this.current_saved_report.data.config.template;\n\n\t\t\t\tfor ( var other_key in this.current_saved_report.data.config.other ) {\n\n\t\t\t\t\tif ( !this.current_saved_report.data.config.other.hasOwnProperty( other_key ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.current_edit_record[other_key] = this.current_saved_report.data.config.other[other_key];\n\t\t\t\t}\n\n\t\t\t\tfor ( var chart_key in this.current_saved_report.data.config.chart ) {\n\n\t\t\t\t\tif ( !this.current_saved_report.data.config.chart.hasOwnProperty( chart_key ) ) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\tthis.current_edit_record[chart_key] = this.current_saved_report.data.config.chart[chart_key];\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\t////If no any saved report, use default setup fields\n\t\t\t\t//var default_setup_fields = this.api.getOptions( 'default_setup_fields', {async: false} );\n\t\t\t\t//$this.current_edit_record.setup_field = default_setup_fields.getResult();\n\t\t\t\t//$this.buildReportUIBaseOnSetupFields();\n\t\t\t\tthis.do_validate_after_create_ui = false;\n\t\t\t\tthis.onTemplateChange( this.templates_array[1].id );\n\t\t\t\tthis.current_edit_record['template'] = this.templates_array[1].id;\n\t\t\t}\n\t\t}\n\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.current_edit_record ) {\n\n\t\t\tif ( !this.current_edit_record.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( widget ) ) {\n\t\t\t\tswitch ( key ) {\n\t\t\t\t\tcase 'user_id':\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'country': //popular case\n\t\t\t\t\t\tthis.setCountryValue( widget, key );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tif ( this.include_form_setup ) {\n\t\t\tthis.api.getCompanyFormConfig( {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar res_Data = result.getResult();\n\t\t\t\t\tif ( res_Data.length == 1 && res_Data.hasOwnProperty( '0' ) && res_Data[0] === false ) {\n\t\t\t\t\t\t//There seem to be cases where the form setup data is somehow saved as the following, which should be ignored, otherwise when trying to re-save the form setup data it doesn't get uploaded to the server because 0 => false.\n\t\t\t\t\t\t// array(1) {\n\t\t\t\t\t\t// [0]=>\n\t\t\t\t\t\t// bool(false)\n\t\t\t\t\t\t// }\n\t\t\t\t\t\t//\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.setFormSetupData( res_Data );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t\tthis.collectUIDataToCurrentEditRecord();\n\n\t\tthis.setDefaultConfigData();\n\t\tthis.setEditViewDataDone();\n\t}\n\n\t/* jshint ignore:end */\n\n\t//set tab 0 visible after all data set done. This be hide when init edit view data\n\tsetEditViewDataDone() {\n//\t\tLocalCacheData.current_doing_context_action = '';\n\t\tthis.setTabOVisibility( true );\n\n\t\tif ( this.do_validate_after_create_ui ) {\n\t\t\tthis.validate();\n\t\t\tthis.do_validate_after_create_ui = false;\n\t\t}\n\n\t\tthis.initRightClickMenuForViewButton();\n\n\t\t//Set url selected tab.\n\t\tif ( window.location.href.indexOf( '&tab=' ) > 0 ) {\n\t\t\tvar tab_name = window.location.href;\n\t\t\ttab_name = tab_name.substr( ( window.location.href.indexOf( '&tab=' ) + 5 ) ); //get the selected tab name\n\t\t\ttab_name = tab_name.substr( 0, window.location.href.indexOf( '&' ) ); // incase there are subsequent arguments after the tab argument\n\t\t\tvar my_tabs = this.edit_view_tab.find( '.edit-view-tab-bar-label' ).children();\n\n\t\t\tfor ( var n = 0; n < my_tabs; n++ ) {\n\t\t\t\tif ( $( my_tabs[n] ).find( 'a' ).length > 0 && tab_name == $( my_tabs[n] ).find( 'a' ).html().replace( /\\/|\\s+/g, '' ) ) {\n\t\t\t\t\t$( my_tabs[n] ).find( 'a' ).click();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tTTPromise.resolve( 'init', 'init' );\n\t\t$( '.edit-view-tab-bar' ).css( 'opacity', 1 );\n\t}\n\n\t//This is just calling into the base anyway, so commented out for now.\n\t// validateResult( result ) {\n\t// \tsuper.validateResult( result );\n\t// },\n\n\tinitRightClickMenuForViewButton() {\n\t\tvar $this = this;\n\t\tvar selector = '#viewHTMLIcon';\n\t\tif ( $( selector ).length == 0 ) {\n\t\t\treturn;\n\t\t}\n\t\tvar items = this.getViewButtonRightClickItems();\n\n\t\tif ( !items || $.isEmptyObject( items ) ) {\n\t\t\treturn;\n\t\t}\n\t\t$.contextMenu( 'destroy', selector );\n\t\t$.contextMenu( {\n\t\t\tselector: selector,\n\t\t\tcallback: function( key, options ) {\n\t\t\t\t$this.onContextMenuClick( null, key );\n\t\t\t},\n\n\t\t\tonContextMenu: function() {\n\t\t\t\treturn false;\n\t\t\t},\n\t\t\titems: items,\n\t\t\tzIndex: 50\n\t\t} );\n\t}\n\n\tgetViewButtonRightClickItems() {\n\t\tvar $this = this;\n\t\tvar items = {};\n\t\titems['viewHTMLIcon'] = {\n\t\t\tname: $.i18n._( 'View' ), icon: 'viewHTMLIcon', disabled: function() {\n\t\t\t\treturn isDisabled();\n\t\t\t}\n\t\t};\n\t\titems['viewHTMLNewWindow'] = {\n\t\t\tname: $.i18n._( 'View (New Window)' ), icon: 'viewHTMLIcon', disabled: function() {\n\t\t\t\treturn isDisabled();\n\t\t\t}\n\t\t};\n\n\t\tfunction isDisabled() {\n\t\t\tif ( $( '#viewHTMLIcon' ).parent().hasClass( 'disable-image' ) ) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn items;\n\t}\n\n//\tonViewRightClick( key ) {\n//\t\t//TODO show view\n//\t\talert('dfdf');\n//\t},\n\n\t// Need always override if report has filter field\n\tonFormItemChangeProcessFilterField() {\n\t}\n\n\t//Shim method to allow override for classes that need their own onFormItemChange for a specific purpose ie payroll export reports\n\t//eg in payroll export, when export_type is changed, we need to execute code but also need the default behaviour of onFormItemChange.\n\tpreFormItemChange( target, doNotDoValidate ) {\n\t\treturn true;\n\t}\n\n\t/* jshint ignore:start */\n\tonFormItemChange( target, doNotDoValidate ) {\n\t\tthis.preFormItemChange( target ); //shim for child class\n\t\tvar $this = this;\n\t\tthis.setIsChanged( target );\n\t\tvar key = target.getField();\n\t\tvar time_period;\n\t\tvar skill_expiry_date;\n\t\tvar membership_renewal_date;\n\t\tvar license_expiry_date;\n\t\tvar education_graduate_date;\n\n\t\tif ( this.visible_report_widgets && ( this.visible_report_widgets[key] || key === 'start_date' || key === 'end_date' || key === 'pay_period_id' || key === 'pay_period_schedule_id' ) ) {\n\t\t\tif ( key === 'sort' ) {\n\t\t\t\tthis.visible_report_values[key] = target.getValue( true );\n\n\t\t\t} else if ( key.indexOf( 'time_period' ) >= 0 ) {\n\n\t\t\t\ttime_period = target.getValue();\n\n\t\t\t\tif ( !this.visible_report_values[key] || this.visible_report_values[key].time_period !== time_period ) {\n\t\t\t\t\tthis.visible_report_values[key] = { time_period: time_period };\n\t\t\t\t\tthis.onTimePeriodChange( target );\n\t\t\t\t}\n\n\t\t\t} else if ( key === 'filter' ) {\n\t\t\t\t//Always needs override\n\t\t\t\tthis.onFormItemChangeProcessFilterField( target, key );\n\n\t\t\t} else if ( key === 'start_date' || key === 'end_date' || key === 'pay_period_id' || key === 'pay_period_schedule_id' ) {\n\t\t\t\ttime_period = this.visible_report_values[target.attr( 'time_period_key' ) ? target.attr( 'time_period_key' ) : 'time_period'];\n\t\t\t\ttime_period[key] = target.getValue();\n\n\t\t\t} else if ( key === 'membership_renewal_date' ) {\n\t\t\t\tmembership_renewal_date = target.getValue();\n\t\t\t\tthis.visible_report_values[key] = { time_period: membership_renewal_date };\n\n\t\t\t\tthis.onMembershipRenewalDateChange( target );\n\t\t\t} else if ( key === 'start_date_1' || key === 'end_date_1' || key === 'pay_period_id_1' || key === 'pay_period_schedule_id_1' ) {\n\t\t\t\tmembership_renewal_date = this.visible_report_values['membership_renewal_date'];\n\t\t\t\tmembership_renewal_date[key.replace( '_1', '' )] = target.getValue();\n\n\t\t\t} else if ( key === 'skill_expiry_date' ) {\n\t\t\t\tskill_expiry_date = target.getValue();\n\t\t\t\tthis.visible_report_values[key] = { time_period: skill_expiry_date };\n\n\t\t\t\tthis.onSkillExpiryDate( target );\n\t\t\t} else if ( key === 'start_date_2' || key === 'end_date_2' || key === 'pay_period_id_2' || key === 'pay_period_schedule_id_2' ) {\n\t\t\t\tskill_expiry_date = this.visible_report_values['skill_expiry_date'];\n\t\t\t\tskill_expiry_date[key.replace( '_2', '' )] = target.getValue();\n\n\t\t\t} else if ( key === 'license_expiry_date' ) {\n\t\t\t\tlicense_expiry_date = target.getValue();\n\t\t\t\tthis.visible_report_values[key] = { time_period: license_expiry_date };\n\n\t\t\t\tthis.onLicenseExpiryDate( target );\n\t\t\t} else if ( key === 'start_date_3' || key === 'end_date_3' || key === 'pay_period_id_3' || key === 'pay_period_schedule_id_3' ) {\n\t\t\t\tlicense_expiry_date = this.visible_report_values['license_expiry_date'];\n\t\t\t\tlicense_expiry_date[key.replace( '_3', '' )] = target.getValue();\n\n\t\t\t} else if ( key === 'education_graduate_date' ) {\n\t\t\t\teducation_graduate_date = target.getValue();\n\t\t\t\tthis.visible_report_values[key] = { time_period: education_graduate_date };\n\n\t\t\t\tthis.onEducationGraduateDate( target );\n\t\t\t} else if ( key === 'start_date_4' || key === 'end_date_4' || key === 'pay_period_id_4' || key === 'pay_period_schedule_id_4' ) {\n\t\t\t\teducation_graduate_date = this.visible_report_values['education_graduate_date'];\n\t\t\t\teducation_graduate_date[key.replace( '_4', '' )] = target.getValue();\n\t\t\t} else {\n\t\t\t\tif ( target.hasClass( 't-checkbox' ) ) {\n\t\t\t\t\tthis.visible_report_values[key] = target.getValue();\n\t\t\t\t} else {\n\t\t\t\t\tvar value = target.getValue();\n\t\t\t\t\tif ( value && ( $.type( value ) !== 'array' || value.length > 0 ) && value != TTUUID.zero_id ) {\n\t\t\t\t\t\tthis.visible_report_values[key] = target.getValue();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdelete this.visible_report_values[key];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tthis.current_edit_record[key] = target.getValue();\n\t\t}\n\n\t\tif ( key === 'template' ) {\n\t\t\t$this.onTemplateChange( this.current_edit_record[key] );\n\t\t\t$this.setEditMenu(); //clean error, set edit menu\n\t\t} else {\n\t\t\tif ( !doNotDoValidate ) {\n\t\t\t\tthis.validate();\n\t\t\t}\n\t\t}\n\n\t\tif ( this.include_form_setup && key === 3 ) {\n\t\t\tthis.form_setup_changed = true;\n\t\t}\n\t}\n\n\t/* jshint ignore:end */\n\n\t//Create first tab widget base on select template\n\tonTemplateChange( templateId ) {\n\t\tvar $this = this;\n\t\tthis.api.getTemplate( templateId, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t$this.setSelectTemplate( result_data );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetSelectTemplate( result_data ) {\n\t\tvar $this = this;\n\t\tvar result = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildRecordArray */ .x.buildRecordArray( result_data );\n\n\t\tvar len = result.length;\n\t\tif ( $this.current_edit_record ) {\n\t\t\t$this.current_edit_record.setup_field = [];\n\t\t\t$this.visible_report_values = {};\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tvar item = result[i];\n\n\t\t\t\tif ( item.value === 'template' ) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$this.visible_report_values[item.value] = item.label; // set value to model\n\t\t\t\t$this.current_edit_record.setup_field.push( item.value );\n\n\t\t\t}\n\n\t\t\t$this.createUI( result );\n\t\t}\n\t}\n\n\tgetFieldLabel( field ) {\n\t\tvar len = this.setup_fields_array.length;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar setup_field = this.setup_fields_array[i];\n\t\t\tif ( setup_field.value === field ) {\n\t\t\t\treturn setup_field.label;\n\t\t\t}\n\t\t}\n\t}\n\n\t//Create widgets,\n\tcreateUI( uiModel ) {\n\n\t\tthis.cleanUI();\n\t\tvar $this = this;\n\t\tvar len = uiModel.length;\n\t\tvar tab_report = this.edit_view_tab.find( '#tab_report' );\n\t\tvar tab0_column1 = tab_report.find( '.first-column' );\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab0_column1 );\n\t\tthis.visible_report_widgets = {}; //report tab widgets\n\t\tthis.edit_view_form_item_dic = {}; //Only keep report tab form item\n\n\t\tthis.visible_report_widgets_order_fix = {};\n\n\t\tvar last_time_visible_values = this.visible_report_values;\n\n\t\tthis.visible_report_values = {};\n\n\t\tvar order_fix = 1001;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar model = uiModel[i];\n\n\t\t\tvar field = '';\n\t\t\tvar value = '';\n\n\t\t\t//Value, label object\n\t\t\tif ( model.value ) {\n\t\t\t\tfield = model.value;\n\n\t\t\t} else { //Mode is string\n\t\t\t\tfield = model;\n\t\t\t}\n\n\t\t\tvalue = last_time_visible_values[field];\n\t\t\tvar widget = this.getUIWidget( field );\n\n\t\t\t//Dont add field is it's not in setup fields.\n\t\t\tif ( !widget || !this.getFieldLabel( field ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//Add widget first\n\t\t\tif ( field.indexOf( 'time_period' ) >= 0 ||\n\t\t\t\tfield === 'membership_renewal_date' ||\n\t\t\t\tfield === 'skill_expiry_date' ||\n\t\t\t\tfield == 'license_expiry_date' ||\n\t\t\t\tfield == 'education_graduate_date'\n\t\t\t) {\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( this.getFieldLabel( field ) ), widget, tab0_column1, '', null, true, true );\n\t\t\t\t$this.edit_view_form_item_dic[field].attr( 'id', 'report_' + field + '_div' );\n\n\t\t\t} else {\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( this.getFieldLabel( field ) ), widget, tab0_column1, '', null, true );\n\t\t\t}\n\n\t\t\t//Then set Value\n\t\t\tif ( value ) {\n\n\t\t\t\tif ( field.indexOf( 'time_period' ) >= 0 ) {\n\t\t\t\t\twidget.setValue( value['time_period'] ); //inside time_period field, the key always be tiem_period\n\t\t\t\t\t$this.onTimePeriodChange( widget, value );\n\t\t\t\t} else if ( field === 'membership_renewal_date' ) {\n\t\t\t\t\twidget.setValue( value.time_period );\n\t\t\t\t\t$this.onMembershipRenewalDateChange( widget, value );\n\t\t\t\t} else if ( field === 'skill_expiry_date' ) {\n\t\t\t\t\twidget.setValue( value.time_period );\n\t\t\t\t\t$this.onSkillExpiryDate( widget, value );\n\t\t\t\t} else if ( field === 'license_expiry_date' ) {\n\t\t\t\t\twidget.setValue( value.time_period );\n\t\t\t\t\t$this.onLicenseExpiryDate( widget, value );\n\t\t\t\t} else if ( field === 'education_graduate_date' ) {\n\t\t\t\t\twidget.setValue( value.time_period );\n\t\t\t\t\t$this.onEducationGraduateDate( widget, value );\n\t\t\t\t} else if ( field === 'filter' ) {\n\t\t\t\t\t$this.setFilterValue( widget, value );\n\t\t\t\t} else if ( field === 'sort' ) {\n\t\t\t\t\twidget.setValue( value );\n\t\t\t\t} else {\n\t\t\t\t\twidget.setValue( value );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t// then init source options\n\n\t\t\tthis.initSourceData( field, widget );\n\n\t\t\tdelete this.current_edit_record[field];\n\n\t\t\tif ( widget.hasClass( 't-checkbox' ) ) {\n\t\t\t\tthis.visible_report_values[field] = value;\n\t\t\t} else if ( value ) {\n\t\t\t\tthis.visible_report_values[field] = value;\n\t\t\t}\n\n\t\t\tthis.visible_report_widgets[field] = widget;\n\n\t\t\tthis.visible_report_widgets_order_fix[field] = order_fix;\n\n\t\t\torder_fix = order_fix + 1;\n\n\t\t}\n\n\t\tthis.setEditViewWidgetsMode();\n\t\tthis.need_refresh_display_columns = false;\n\t\tthis.editFieldResize( 0 );\n\t}\n\n\t// onTabIndexChange( e, ui ) {\n\t//\n\t// },\t// onTabIndexChange: function( e, ui ) {\n\t//\n\t// },\n\t/* jshint ignore:start */\n\tonTabShow( e ) {\n\t\tvar $this = this;\n\t\tvar key = $( e.target ).tabs( 'option', 'active' );\n\n\t\tthis.editFieldResize( key );\n\n\t\tif ( !this.current_edit_record ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar last_index = this.getEditViewTabIndex();\n\n\t\tif ( !this.include_form_setup ) {\n\t\t\tif ( ( last_index === 1 || this.need_refresh_display_columns ) && key === 0 ) {\n\t\t\t\tthis.buildReportUIBaseOnSetupFields();\n\t\t\t\tthis.buildContextMenu( true );\n\t\t\t\tthis.setEditMenu();\n\t\t\t} else if ( key === 1 ) {\n\t\t\t\tthis.edit_view_ui_dic.setup_field.setValue( this.current_edit_record.setup_field );\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() == 10 ) {\n\t\t\t\t\tthis.edit_view_ui_dic.auto_refresh.parent().parent().css( 'display', 'none' );\n\t\t\t\t}\n\t\t\t\tthis.buildContextMenu( true );\n\t\t\t\tthis.setEditMenu();\n\t\t\t} else if ( key === 2 ) {\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_chart' ).find( '.first-column' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'none' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_chart' ).find( '.first-column' ).css( 'display', 'none' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-message' ).html( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getUpgradeMessage */ .x.getUpgradeMessage() );\n\t\t\t\t}\n\t\t\t} else if ( key === 3 ) {\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_custom_columns' ).find( '.first-column-sub-view' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'none' );\n\t\t\t\t\tthis.initSubCustomColumnView();\n\t\t\t\t} else {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_custom_columns' ).find( '.first-column-sub-view' ).css( 'display', 'none' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-message' ).html( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getUpgradeMessage */ .x.getUpgradeMessage() );\n\n\t\t\t\t}\n\n\t\t\t} else if ( key === 4 ) {\n\t\t\t\tthis.initSubSavedReportView();\n\t\t\t} else {\n\t\t\t\tthis.buildContextMenu( true );\n\t\t\t\tthis.setEditMenu();\n\t\t\t}\n\t\t} else {\n\t\t\tif ( ( last_index === 1 || this.need_refresh_display_columns ) && key === 0 ) {\n\t\t\t\tthis.buildReportUIBaseOnSetupFields();\n\t\t\t\tthis.buildContextMenu( true );\n\t\t\t\tthis.setEditMenu();\n\t\t\t} else if ( key === 1 ) {\n\t\t\t\tthis.edit_view_ui_dic.setup_field.setValue( this.current_edit_record.setup_field );\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() == 10 ) {\n\t\t\t\t\tthis.edit_view_ui_dic.auto_refresh.parent().parent().css( 'display', 'none' );\n\t\t\t\t}\n\t\t\t\tthis.buildContextMenu( true );\n\t\t\t\tthis.setEditMenu();\n\t\t\t} else if ( key === 2 ) {\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_chart' ).find( '.first-column' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'none' );\n\t\t\t\t} else {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_chart' ).find( '.first-column' ).css( 'display', 'none' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-message' ).html( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getUpgradeMessage */ .x.getUpgradeMessage() );\n\t\t\t\t}\n\t\t\t} else if ( key === 4 ) {\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_form_setup' ).find( '.first-column-sub-view' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'none' );\n\t\t\t\t\tthis.initSubCustomColumnView();\n\t\t\t\t} else {\n\t\t\t\t\tthis.edit_view_tab.find( '#tab_form_setup' ).find( '.first-column-sub-view' ).css( 'display', 'none' );\n\t\t\t\t\tthis.edit_view.find( '.permission-defined-div' ).css( 'display', 'block' );\n\t\t\t\t\tthis.edit_view.find( '.permission-message' ).html( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getUpgradeMessage */ .x.getUpgradeMessage() );\n\n\t\t\t\t}\n\t\t\t} else if ( key === 5 ) {\n\t\t\t\tthis.initSubSavedReportView();\n\t\t\t} else {\n\t\t\t\tthis.buildContextMenu( true );\n\t\t\t\tthis.setEditMenu();\n\t\t\t}\n\n\t\t\tthis.checkFormSetupSaved( last_index );\n\n\t\t}\n\n\t\tif ( key === 0 ) {\n\t\t\tthis.validate();\n\t\t}\n\t}\n\n\t/**\n\t * Copied to ROEViewController as it doesn't share this base\n\t * FIXME: might need to go into BaseViewController eventually\n\t * @param label\n\t */\n\tcheckFormSetupSaved( last_index, label ) {\n\t\tvar $this = this;\n\n\t\tif ( label == undefined ) {\n\t\t\tlabel = $.i18n._( 'Form Setup' );\n\t\t}\n\n\t\tif ( last_index === 3 && this.form_setup_changed ) {\n\t\t\t$this.form_setup_changed = false;\n\t\t\tTAlertManager.showConfirmAlert( $.i18n._( 'You have modified' ) + ' ' + label + ' ' + $.i18n._( 'data without saving, would you like to save your data now?' ), '', function( flag ) {\n\t\t\t\tif ( flag ) {\n\t\t\t\t\t$this.onSaveSetup( label );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/* jshint ignore:end */\n\tcleanUI() {\n\t\tfor ( var key in this.edit_view_form_item_dic ) {\n\t\t\tif ( !this.edit_view_form_item_dic.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar html_item = this.edit_view_form_item_dic[key];\n\n\t\t\t//Check if its a separator with a key of separated_X and skip removing it if it is.\n\t\t\t// FIXME: Would be nice to get a better way to detect a separator widget.\n\t\t\tif ( typeof html_item.getField === 'undefined' && key.indexOf('separated_') != -1 ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\thtml_item.remove();\n\t\t}\n\n\t\t//Error: TypeError: this.edit_view_tab is null in /interface/html5/views/reports/ReportBaseViewController.js?v=8.0.4-20150320-094021 line 1100\n\t\tif ( this.edit_view_tab ) {\n\t\t\tvar tab_report = this.edit_view_tab.find( '#tab_report' );\n\n\t\t\tvar tab0_column1 = tab_report.find( '.first-column' );\n\n\t\t\tvar clear_both_div = tab0_column1.find( '.clear-both-div' );\n\n\t\t\tclear_both_div.remove();\n\t\t}\n\t\t$( '.errortip-box' ).remove();\n\t\t$( '.errortip-box' ).remove();\n\t}\n\n\tremoveEditView() {\n\n\t\tsuper.removeEditView();\n\t\tthis.sub_custom_column_view_controller = null;\n\t\tthis.sub_saved_report_view_controller = null;\n\n\t\t//this is also happening in Ribbonviewcontoller in onSubMenuClick\n\t\tLocalCacheData.current_open_report_controller = null;\n\t}\n\n\t/* jshint ignore:start */\n\n\t//Get Widget base on field\n\tgetUIWidget( field ) {\n\t\tvar widget;\n\n\t\tif ( field.indexOf( 'time_period' ) >= 0 ) {\n\t\t\twidget = this.getSimpleTComboBox( field, false );\n\t\t} else {\n\n\t\t\tswitch ( field ) {\n\t\t\t\tcase 'is_reprint':\n\t\t\t\t\twidget = this.getCheckBox( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'columns':\n\t\t\t\tcase 'sub_total':\n\t\t\t\tcase 'group':\n\t\t\t\tcase 'page_break':\n\t\t\t\tcase 'user_review_control_type_id':\n\t\t\t\tcase 'user_review_control_status_id':\n\t\t\t\tcase 'severity_id':\n\t\t\t\tcase 'term_id':\n\t\t\t\tcase 'kpi_type_id':\n\t\t\t\tcase 'kpi_status_id':\n\t\t\t\tcase 'fluency_id':\n\t\t\t\tcase 'qualification_type_id':\n\t\t\t\tcase 'proficiency_id':\n\t\t\t\tcase 'competency_id':\n\t\t\t\tcase 'ownership_id':\n\t\t\t\tcase 'invoice_status_id':\n\t\t\t\tcase 'user_status_id':\n\t\t\t\tcase 'pay_stub_status_id':\n\t\t\t\tcase 'filter':\n\t\t\t\tcase 'pay_period_time_sheet_verify_status_id':\n\t\t\t\tcase 'job_status_id':\n\t\t\t\tcase 'job_item_status_id':\n\t\t\t\tcase 'client_status_id':\n\t\t\t\tcase 'product_type_id':\n\t\t\t\tcase 'custom_filter':\n\t\t\t\tcase 'log_action_id':\n\t\t\t\tcase 'log_table_name_id':\n\t\t\t\tcase 'accrual_type_id':\n\t\t\t\tcase 'accrual_policy_type_id':\n\t\t\t\tcase 'exception_policy_severity_id':\n\t\t\t\tcase 'exception_policy_type_id':\n\t\t\t\tcase 'expense_policy_require_receipt_id':\n\t\t\t\tcase 'expense_policy_type_id':\n\t\t\t\tcase 'user_expense_payment_method_id':\n\t\t\t\tcase 'user_expense_status_id':\n\t\t\t\tcase 'job_applicant_sex_id':\n\t\t\t\tcase 'job_applicant_status_id':\n\t\t\t\tcase 'job_application_status_id':\n\t\t\t\tcase 'job_application_type_id':\n\t\t\t\tcase 'job_vacancy_employment_status_id':\n\t\t\t\tcase 'job_vacancy_level_id':\n\t\t\t\tcase 'job_vacancy_status_id':\n\t\t\t\tcase 'job_vacancy_type_id':\n\t\t\t\tcase 'job_vacancy_wage_type_id':\n\t\t\t\tcase 'pay_stub_run_id':\n\t\t\t\tcase 'pay_stub_type_id':\n\t\t\t\tcase 'remittance_source_account_type_id':\n\t\t\t\tcase 'transaction_type_id':\n\t\t\t\tcase 'transaction_status_id':\n\t\t\t\t\twidget = this.getSimpleTComboBox( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'sort':\n\t\t\t\t\twidget = this.getSortComboBox( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'license_expiry_date':\n\t\t\t\tcase 'membership_renewal_date':\n\t\t\t\tcase 'skill_expiry_date':\n\t\t\t\tcase 'education_graduate_date':\n\t\t\t\t\twidget = this.getComboBox( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_group_id':\n\t\t\t\tcase 'qualification_group_id':\n\t\t\t\tcase 'kpi_group_id':\n\t\t\t\tcase 'job_group_id':\n\t\t\t\tcase 'job_item_group_id':\n\t\t\t\tcase 'client_group_id':\n\t\t\t\tcase 'product_group_id':\n\t\t\t\t\twidget = this.getTreeModeAComboBox( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_tag':\n\t\t\t\tcase 'review_tag':\n\t\t\t\tcase 'job_tag':\n\t\t\t\tcase 'job_item_tag':\n\t\t\t\t\twidget = this.getTag( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'include_user_id':\n\t\t\t\tcase 'exclude_user_id':\n\t\t\t\tcase 'client_sales_contact_id':\n\t\t\t\tcase 'created_by_id':\n\t\t\t\tcase 'updated_by_id':\n\t\t\t\tcase 'include_reviewer_user_id':\n\t\t\t\tcase 'exclude_reviewer_user_id':\n\t\t\t\tcase 'job_applicant_interviewer_user_id':\n\t\t\t\tcase 'job_application_interviewer_user_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_user', TTAPI.APIUser );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_title_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_user_title', TTAPI.APIUserTitle );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'payroll_remittance_agency_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_payroll_remittance_agency', TTAPI.APIPayrollRemittanceAgency );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'legal_entity_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_legal_entity', TTAPI.APILegalEntity );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'policy_group_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_policy_group', TTAPI.APIPolicyGroup );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'default_branch_id':\n\t\t\t\tcase 'schedule_branch_id':\n\t\t\t\tcase 'punch_branch_id':\n\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_branch', TTAPI.APIBranch );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'default_department_id':\n\t\t\t\tcase 'schedule_department_id':\n\t\t\t\tcase 'punch_department_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_department', TTAPI.APIDepartment );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'default_job_id':\n\t\t\t\tcase 'punch_job_id':\n\t\t\t\tcase 'include_job_id':\n\t\t\t\tcase 'exclude_job_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_job', TTAPI.APIJob );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'default_job_item_id':\n\t\t\t\tcase 'punch_job_item_id':\n\t\t\t\tcase 'include_job_item_id':\n\t\t\t\tcase 'exclude_job_item_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_job_item', TTAPI.APIJobItem );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'absence_policy_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_absences', TTAPI.APIAbsencePolicy );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'currency_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_currency', TTAPI.APICurrency );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'include_no_data_rows':\n\t\t\t\tcase 'exclude_ytd_adjustment':\n\t\t\t\tcase 'show_child_expenses':\n\t\t\t\t\twidget = this.getCheckBox( field );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accrual_policy_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_accrual', TTAPI.APIAccrualPolicy );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pay_period_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_Pay_period', TTAPI.APIPayPeriod );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_id':\n\t\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\twidget = this.getTComboBox( field, 'global_job', TTAPI.APIJob );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_item_id':\n\t\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\twidget = this.getTComboBox( field, 'global_job_item', TTAPI.APIJobItem );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'default_punch_tag_id':\n\t\t\t\tcase 'punch_tag_id':\n\t\t\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\twidget = this.getTComboBox( field, 'global_punch_tag', TTAPI.APIPunchTag );\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'expense_policy_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_expense_policy', TTAPI.APIExpensePolicy );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'pay_stub_entry_account_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_PayStubAccount', TTAPI.APIPayStubEntryAccount );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'product_id':\n\t\t\t\tcase 'exclude_product_id':\n\t\t\t\tcase 'include_product_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_product', TTAPI.APIProduct );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_client_id':\n\t\t\t\tcase 'exclude_client_id':\n\t\t\t\tcase 'include_client_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_client', TTAPI.APIClient );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'company_deduction_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_deduction', TTAPI.APICompanyDeduction );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'qualification_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_qualification', TTAPI.APIQualification );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'kpi_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_kpi', TTAPI.APIKPI );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_applicant_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_job_applicant', TTAPI.APIJobApplicant );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'job_vacancy_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_job_vacancy', TTAPI.APIJobVacancy );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accrual_policy_account_id':\n\t\t\t\t\twidget = this.getTComboBox( field, 'global_accrual_policy_account', TTAPI.APIAccrualPolicyAccount );\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\n\t\t\t\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( ReportBaseViewController.ReportMissedField ) ) {\n\t\t\t\t\t\tReportBaseViewController.ReportMissedField = {};\n\t\t\t\t\t}\n\n\t\t\t\t\tReportBaseViewController.ReportMissedField[field] = true;\n\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}\n\n\t\treturn widget;\n\t}\n\n\t/* jshint ignore:end */\n\tgetTag( field ) {\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TAG_INPUT );\n\n\t\twidget.TTagInput( { field: field } );\n\n\t\treturn widget;\n\t}\n\n\tgetTreeModeAComboBox( field ) {\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\twidget = widget.AComboBox( {\n\t\t\ttree_mode: true,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: 'global_tree_column',\n\t\t\tset_empty: true,\n\t\t\tfield: field\n\t\t} );\n\n\t\treturn widget;\n\t}\n\n\tgetCheckBox( field ) {\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\n\t\twidget = widget.TCheckbox( {\n\t\t\tfield: field\n\t\t} );\n\n\t\treturn widget;\n\t}\n\n\tgetTComboBox( field, layoutName, apiClass ) {\n\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\twidget = widget.AComboBox( {\n\t\t\tapi_class: apiClass,\n\t\t\tallow_multiple_selection: true,\n\t\t\tlayout_name: layoutName,\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: field\n\t\t} );\n\n\t\treturn widget;\n\t}\n\n\tgetSortComboBox( field ) {\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\twidget = widget.AComboBox( {\n\t\t\tfield: field,\n\t\t\tallow_drag_to_order: true,\n\t\t\tallow_multiple_selection: true,\n\t\t\tset_empty: true,\n\t\t\tlayout_name: 'global_sort_columns'\n\t\t} );\n\n\t\treturn widget;\n\t}\n\n\tgetSimpleTComboBox( field, allowMultiple ) {\n\n\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( allowMultiple ) ) {\n\t\t\tallowMultiple = true;\n\t\t}\n\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\twidget = widget.AComboBox( {\n\t\t\tfield: field,\n\t\t\tset_empty: true,\n\t\t\tallow_multiple_selection: allowMultiple,\n\t\t\tlayout_name: 'global_option_column',\n\t\t\tkey: 'value'\n\t\t} );\n\n\t\treturn widget;\n\t}\n\n\tgetComboBox( field ) {\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\twidget = widget.TComboBox( {\n\t\t\tfield: field,\n\t\t\tset_empty: true\n\t\t} );\n\n\t\treturn widget;\n\t}\n\n\t/* jshint ignore:start */\n\tinitSourceData( field, widget ) {\n\n\t\tvar api_instance = null;\n\t\tvar option = '';\n\t\tvar $this = this;\n\n\t\tswitch ( field ) {\n\t\t\tcase 'sort':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'columns';\n\n\t\t\t\tapi_instance.getOptions( option, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tonResult( result );\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t\tbreak;\n\t\t\tcase 'kpi_group_id':\n\t\t\t\tTTAPI.APIKPIGroup.getKPIGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\n\t\t\tcase 'qualification_group_id':\n\t\t\t\tTTAPI.APIQualificationGroup.getQualificationGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'product_group_id':\n\t\t\t\tTTAPI.APIProductGroup.getProductGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'client_group_id':\n\t\t\t\tTTAPI.APIClientGroup.getClientGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'user_group_id':\n\t\t\t\tTTAPI.APIUserGroup.getUserGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'policy_group_id':\n\t\t\t\tTTAPI.PolicyGroup.getPolicyGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'job_group_id':\n\t\t\t\tTTAPI.APIJobGroup.getJobGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'job_item_group_id':\n\t\t\t\tTTAPI.APIJobItemGroup.getJobItemGroup( '', false, false, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\tres = res.getResult();\n\t\t\t\t\t\tres = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildTreeRecord */ .x.buildTreeRecord( res );\n\t\t\t\t\t\twidget.setSourceData( res );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tcase 'job_vacancy_employment_status_id':\n\t\t\t\tapi_instance = TTAPI.APIJobVacancy;\n\t\t\t\toption = 'employment_status';\n\t\t\t\tbreak;\n\t\t\tcase 'job_vacancy_level_id':\n\t\t\t\tapi_instance = TTAPI.APIJobVacancy;\n\t\t\t\toption = 'level';\n\t\t\t\tbreak;\n\t\t\tcase 'job_vacancy_status_id':\n\t\t\t\tapi_instance = TTAPI.APIJobVacancy;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'job_vacancy_type_id':\n\t\t\t\tapi_instance = TTAPI.APIJobVacancy;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'job_vacancy_wage_type_id':\n\t\t\t\tapi_instance = TTAPI.APIJobVacancy;\n\t\t\t\toption = 'wage_type';\n\t\t\t\tbreak;\n\t\t\tcase 'job_application_status_id':\n\t\t\t\tapi_instance = TTAPI.APIJobApplication;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'job_application_type_id':\n\t\t\t\tapi_instance = TTAPI.APIJobApplication;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'job_applicant_sex_id':\n\t\t\t\tapi_instance = TTAPI.APIJobApplicant;\n\t\t\t\toption = 'sex';\n\t\t\t\tbreak;\n\t\t\tcase 'job_applicant_status_id':\n\t\t\t\tapi_instance = TTAPI.APIJobApplicant;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'user_review_control_type_id':\n\t\t\t\tapi_instance = TTAPI.APIUserReviewControl;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'user_review_control_status_id':\n\t\t\t\tapi_instance = TTAPI.APIUserReviewControl;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'severity_id':\n\t\t\t\tapi_instance = TTAPI.APIUserReviewControl;\n\t\t\t\toption = 'severity';\n\t\t\t\tbreak;\n\t\t\tcase 'term_id':\n\t\t\t\tapi_instance = TTAPI.APIUserReviewControl;\n\t\t\t\toption = 'term';\n\t\t\t\tbreak;\n\t\t\tcase 'kpi_status_id':\n\t\t\t\tapi_instance = TTAPI.APIKPI;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'kpi_type_id':\n\t\t\t\tapi_instance = TTAPI.APIKPI;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'proficiency_id':\n\t\t\t\tapi_instance = TTAPI.APIUserSkill;\n\t\t\t\toption = 'proficiency';\n\t\t\t\tbreak;\n\t\t\tcase 'fluency_id':\n\t\t\t\tapi_instance = TTAPI.APIUserLanguage;\n\t\t\t\toption = 'fluency';\n\t\t\t\tbreak;\n\t\t\tcase 'competency_id':\n\t\t\t\tapi_instance = TTAPI.APIUserLanguage;\n\t\t\t\toption = 'competency';\n\t\t\t\tbreak;\n\t\t\tcase 'user_status_id':\n\t\t\t\tapi_instance = TTAPI.APIUser;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub_status_id':\n\t\t\t\tapi_instance = TTAPI.APIPayStub;\n\t\t\t\toption = 'filtered_status';\n\t\t\t\tbreak;\n\t\t\tcase 'ownership_id':\n\t\t\t\tapi_instance = TTAPI.APIUserMembership;\n\t\t\t\toption = 'ownership';\n\t\t\t\tbreak;\n\t\t\tcase 'license_expiry_date':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'license_expiry_date';\n\t\t\t\tbreak;\n\t\t\tcase 'membership_renewal_date':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'membership_renewal_date';\n\t\t\t\tbreak;\n\t\t\tcase 'skill_expiry_date':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'skill_expiry_date';\n\t\t\t\tbreak;\n\t\t\tcase 'education_graduate_date':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'education_graduate_date';\n\t\t\t\tbreak;\n\t\t\tcase 'group':\n\t\t\tcase 'sub_total':\n\t\t\tcase 'page_break':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'static_columns';\n\t\t\t\tbreak;\n\t\t\tcase 'pay_period_time_sheet_verify_status_id':\n\t\t\t\tapi_instance = TTAPI.APIPayPeriodTimeSheetVerify;\n\t\t\t\t//show valid values specific to the report\n\t\t\t\toption = 'filter_report_status';\n\t\t\t\tbreak;\n\t\t\tcase 'job_status_id':\n\t\t\t\tapi_instance = TTAPI.APIJob;\n\t\t\t\toption = 'status';\n\n\t\t\t\tbreak;\n\t\t\tcase 'custom_filter':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'report_custom_filters';\n\t\t\t\tbreak;\n\n\t\t\tcase 'log_action_id':\n\n\t\t\t\tapi_instance = TTAPI.APILog;\n\t\t\t\toption = 'action';\n\n\t\t\t\tbreak;\n\t\t\tcase 'log_table_name_id':\n\n\t\t\t\tapi_instance = TTAPI.APILog;\n\t\t\t\toption = 'table_name';\n\n\t\t\t\tbreak;\n\t\t\tcase 'filter':\n\t\t\t\tif ( this.script_name === 'ScheduleSummaryReport' ) {\n\t\t\t\t\tapi_instance = TTAPI.APISchedule;\n\t\t\t\t\toption = 'status';\n\t\t\t\t} else if ( this.script_name === 'InvoiceTransactionSummaryReport' ) {\n\t\t\t\t\tapi_instance = TTAPI.APITransaction;\n\t\t\t\t\toption = 'type';\n\t\t\t\t} else if ( this.script_name === 'PayStubSummaryReport' ) {\n\t\t\t\t\tapi_instance = TTAPI.APIPayStub;\n\t\t\t\t\toption = 'status';\n\t\t\t\t} else if ( this.script_name === 'ActiveShiftReport' ) {\n\t\t\t\t\tapi_instance = TTAPI.APIUser;\n\t\t\t\t\toption = 'status';\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'accrual_policy_type_id':\n\t\t\t\tapi_instance = TTAPI.APIAccrualPolicy;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'accrual_type_id':\n\t\t\t\tapi_instance = TTAPI.APIAccrual;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'qualification_type_id':\n\t\t\t\tapi_instance = TTAPI.APIQualification;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'exception_policy_type_id':\n\t\t\t\tapi_instance = TTAPI.APIExceptionPolicy;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'exception_policy_severity_id':\n\t\t\t\tapi_instance = TTAPI.APIExceptionPolicy;\n\t\t\t\toption = 'severity';\n\t\t\t\tbreak;\n\t\t\tcase 'expense_policy_require_receipt_id':\n\t\t\t\tapi_instance = TTAPI.APIExpensePolicy;\n\t\t\t\toption = 'require_receipt';\n\t\t\t\tbreak;\n\t\t\tcase 'expense_policy_type_id':\n\t\t\t\tapi_instance = TTAPI.APIExpensePolicy;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'user_expense_payment_method_id':\n\t\t\t\tapi_instance = TTAPI.APIUserExpense;\n\t\t\t\toption = 'payment_method';\n\t\t\t\tbreak;\n\t\t\tcase 'user_expense_status_id':\n\t\t\t\tapi_instance = TTAPI.APIUserExpense;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'job_item_status_id':\n\t\t\t\tapi_instance = TTAPI.APIJobItem;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'client_status_id':\n\t\t\t\tapi_instance = TTAPI.APIClient;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'invoice_status_id':\n\t\t\t\tapi_instance = TTAPI.APIInvoice;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'invoice_transaction_type_id':\n\t\t\t\tapi_instance = TTAPI.APITransaction;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'product_type_id':\n\t\t\t\tapi_instance = TTAPI.APIProduct;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub_type_id':\n\t\t\t\tapi_instance = TTAPI.APIPayStub;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'transaction_type_id':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'type';\n\t\t\t\tbreak;\n\t\t\tcase 'transaction_status_id':\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = 'status';\n\t\t\t\tbreak;\n\t\t\tcase 'pay_stub_run_id':\n\t\t\t\tvar result = {};\n\t\t\t\tfor ( var i = 1; i <= 128; i++ ) {\n\t\t\t\t\tresult[i] = i;\n\t\t\t\t}\n\t\t\t\tresult = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildRecordArray */ .x.buildRecordArray( result );\n\t\t\t\twidget.setSourceData( result );\n\t\t\t\treturn;\n\t\t\tdefault:\n\t\t\t\t//Don't deal with awesomebox with api\n\t\t\t\tif ( widget.getAPI && widget.getAPI() ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//Text Input or other no options widget\n\t\t\t\tif ( !widget.setSourceData ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tfield.replace( '_id', '' );\n\n\t\t\t\tapi_instance = this.api;\n\t\t\t\toption = field;\n\t\t\t\tif ( field.indexOf( 'time_period' ) >= 0 ) {\n\t\t\t\t\toption = 'time_period';\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( api_instance ) {\n\n\t\t\tif ( this.need_refresh_display_columns && ( option === 'columns' || field == 'custom_filter' ) ) {\n\t\t\t\tapi_instance.getOptions( option, {\n\t\t\t\t\tnoCache: true, onResult: function( result ) {\n\n\t\t\t\t\t\tonResult( result );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tapi_instance.getOptions( option, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\tonResult( result );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t}\n\n\t\tfunction onResult( result ) {\n\n\t\t\tvar res_data = result.getResult();\n\t\t\tres_data = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildRecordArray */ .x.buildRecordArray( res_data );\n\t\t\tif ( field === 'sort' ) {\n\t\t\t\tres_data = $this.buildSortSelectorUnSelectColumns( res_data );\n\t\t\t} else if ( field.indexOf( 'time_period' ) >= 0 ) {\n\t\t\t\t$this.time_period_array = res_data;\n\t\t\t}\n\n\t\t\twidget.setSourceData( res_data );\n\n\t\t}\n\t}\n\n\t/* jshint ignore:end */\n\tgetDatePicker( field ) {\n\t\tvar widget = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\twidget.TDatePicker( { field: field } );\n\n\t\treturn widget;\n\t}\n\n\tputInputToInsideFormItem( form_item_input, label ) {\n\t\tvar form_item = $( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( WidgetNamesDic.EDIT_VIEW_SUB_FORM_ITEM ) );\n\t\tvar form_item_label = form_item.find( '.edit-view-form-item-label' );\n\t\tvar form_item_input_div = form_item.find( '.edit-view-form-item-input-div' );\n\t\tform_item.addClass( 'remove-margin' );\n\n\t\tform_item_label.text( $.i18n._( label ) );\n\t\tform_item_input_div.append( form_item_input );\n\n\t\treturn form_item;\n\t}\n\n\tonLicenseExpiryDate( target, defaultValue ) {\n\n\t\tvar $this = this;\n\t\tvar value = target.getValue();\n\n\t\tthis.visible_report_widgets.license_expiry_date = null;\n\t\tthis.visible_report_widgets.start_date_3 = null;\n\t\tthis.visible_report_widgets.end_date_3 = null;\n\t\tthis.visible_report_widgets.pay_period_id_3 = null;\n\t\tthis.visible_report_widgets.pay_period_schedule_id_3 = null;\n\n\t\tif ( value === 'custom_date' ) {\n\t\t\tbuildCustomDateUI();\n\t\t} else if ( value === 'custom_pay_period' ) {\n\t\t\tbuildPayPeriodUI();\n\t\t} else if ( value === 'this_pay_period' || value === 'last_pay_period' || value === 'to_last_pay_period' || value === 'to_this_pay_period' ) {\n\t\t\tbuildPayPeriodScheduleUI();\n\t\t} else {\n\t\t\tbuildDefaultUI();\n\t\t}\n\n\t\tfunction buildPayPeriodScheduleUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_license_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'license_expiry_date', false, false );\n\t\t\t$this.initSourceData( 'license_expiry_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_schedule_id_3', 'global_pay_period_schedule', TTAPI.APIPayPeriodSchedule );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period Schedule' ) );\n\n\t\t\t$this.visible_report_widgets.license_expiry_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_schedule_id_3 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_schedule_id );\n\t\t\t}\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 120 );\n\n\t\t\tform_input_div.append( v_box );\n\t\t}\n\n\t\tfunction buildPayPeriodUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_license_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'license_expiry_date', false, false );\n\t\t\t$this.initSourceData( 'license_expiry_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_id_3', 'global_Pay_period', TTAPI.APIPayPeriod );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period' ) );\n\n\t\t\t$this.visible_report_widgets.license_expiry_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_id_3 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_id );\n\t\t\t}\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t}\n\n\t\tfunction buildDefaultUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_license_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'license_expiry_date', false, false );\n\n\t\t\tform_input_div.append( time_period );\n\n\t\t\ttime_period.setValue( value );\n\n\t\t\t$this.initSourceData( 'license_expiry_date', time_period );\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\t$this.visible_report_widgets.license_expiry_date = time_period;\n\n\t\t}\n\n\t\tfunction buildCustomDateUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_license_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'license_expiry_date', false, false );\n\t\t\t$this.initSourceData( 'license_expiry_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar start_date = $this.getDatePicker( 'start_date_3' );\n\n\t\t\tvar end_date = $this.getDatePicker( 'end_date_3' );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tstart_date.setValue( defaultValue.start_date );\n\t\t\t\tend_date.setValue( defaultValue.end_date );\n\t\t\t}\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( start_date, $.i18n._( 'Start Date' ) );\n\t\t\tvar form_item3 = $this.putInputToInsideFormItem( end_date, $.i18n._( 'End Date' ) );\n\n\t\t\t$this.visible_report_widgets.license_expiry_date = time_period;\n\t\t\t$this.visible_report_widgets.start_date_3 = start_date;\n\t\t\t$this.visible_report_widgets.end_date_3 = end_date;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tstart_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tend_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t}\n\t}\n\n\tonEducationGraduateDate( target, defaultValue ) {\n\n\t\tvar $this = this;\n\t\tvar value = target.getValue();\n\n\t\tthis.visible_report_widgets.education_graduate_date = null;\n\t\tthis.visible_report_widgets.start_date_4 = null;\n\t\tthis.visible_report_widgets.end_date_4 = null;\n\t\tthis.visible_report_widgets.pay_period_id_4 = null;\n\t\tthis.visible_report_widgets.pay_period_schedule_id_4 = null;\n\n\t\tif ( value === 'custom_date' ) {\n\t\t\tbuildCustomDateUI();\n\t\t} else if ( value === 'custom_pay_period' ) {\n\t\t\tbuildPayPeriodUI();\n\t\t} else if ( value === 'this_pay_period' || value === 'last_pay_period' || value === 'to_last_pay_period' || value === 'to_this_pay_period' ) {\n\t\t\tbuildPayPeriodScheduleUI();\n\t\t} else {\n\t\t\tbuildDefaultUI();\n\t\t}\n\n\t\tfunction buildPayPeriodScheduleUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_education_graduate_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'education_graduate_date', false, false );\n\t\t\t$this.initSourceData( 'education_graduate_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_schedule_id_4', 'global_pay_period_schedule', TTAPI.APIPayPeriodSchedule );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period Schedule' ) );\n\n\t\t\t$this.visible_report_widgets.education_graduate_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_schedule_id_4 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_schedule_id );\n\t\t\t}\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 120 );\n\n\t\t\tform_input_div.append( v_box );\n\t\t}\n\n\t\tfunction buildPayPeriodUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_education_graduate_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'education_graduate_date', false, false );\n\t\t\t$this.initSourceData( 'education_graduate_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_id_4', 'global_Pay_period', TTAPI.APIPayPeriod );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period' ) );\n\n\t\t\t$this.visible_report_widgets.education_graduate_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_id_4 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_id );\n\t\t\t}\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t}\n\n\t\tfunction buildDefaultUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_education_graduate_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'education_graduate_date', false, false );\n\n\t\t\tform_input_div.append( time_period );\n\n\t\t\ttime_period.setValue( value );\n\n\t\t\t$this.initSourceData( 'education_graduate_date', time_period );\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\t$this.visible_report_widgets.education_graduate_date = time_period;\n\n\t\t}\n\n\t\tfunction buildCustomDateUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_education_graduate_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'education_graduate_date', false, false );\n\t\t\t$this.initSourceData( 'education_graduate_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar start_date = $this.getDatePicker( 'start_date_4' );\n\n\t\t\tvar end_date = $this.getDatePicker( 'end_date_4' );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tstart_date.setValue( defaultValue.start_date );\n\t\t\t\tend_date.setValue( defaultValue.end_date );\n\t\t\t}\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( start_date, $.i18n._( 'Start Date' ) );\n\t\t\tvar form_item3 = $this.putInputToInsideFormItem( end_date, $.i18n._( 'End Date' ) );\n\n\t\t\t$this.visible_report_widgets.education_graduate_date = time_period;\n\t\t\t$this.visible_report_widgets.start_date_4 = start_date;\n\t\t\t$this.visible_report_widgets.end_date_4 = end_date;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tstart_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tend_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t}\n\t}\n\n\tonSkillExpiryDate( target, defaultValue ) {\n\n\t\tvar $this = this;\n\t\tvar value = target.getValue();\n\n\t\tthis.visible_report_widgets.skill_expiry_date = null;\n\t\tthis.visible_report_widgets.start_date_2 = null;\n\t\tthis.visible_report_widgets.end_date_2 = null;\n\t\tthis.visible_report_widgets.pay_period_id_2 = null;\n\t\tthis.visible_report_widgets.pay_period_schedule_id_2 = null;\n\n\t\tif ( value === 'custom_date' ) {\n\t\t\tbuildCustomDateUI();\n\t\t} else if ( value === 'custom_pay_period' ) {\n\t\t\tbuildPayPeriodUI();\n\t\t} else if ( value === 'this_pay_period' || value === 'last_pay_period' || value === 'to_last_pay_period' || value === 'to_this_pay_period' ) {\n\t\t\tbuildPayPeriodScheduleUI();\n\t\t} else {\n\t\t\tbuildDefaultUI();\n\t\t}\n\n\t\tfunction buildPayPeriodScheduleUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_skill_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'skill_expiry_date', false, false );\n\t\t\t$this.initSourceData( 'skill_expiry_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_schedule_id_2', 'global_pay_period_schedule', TTAPI.APIPayPeriodSchedule );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period Schedule' ) );\n\n\t\t\t$this.visible_report_widgets.skill_expiry_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_schedule_id_2 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_schedule_id );\n\t\t\t}\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 120 );\n\n\t\t\tform_input_div.append( v_box );\n\t\t}\n\n\t\tfunction buildPayPeriodUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_skill_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'skill_expiry_date', false, false );\n\t\t\t$this.initSourceData( 'skill_expiry_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_id_2', 'global_Pay_period', TTAPI.APIPayPeriod );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period' ) );\n\n\t\t\t$this.visible_report_widgets.skill_expiry_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_id_2 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_id );\n\t\t\t}\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t}\n\n\t\tfunction buildDefaultUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_skill_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'skill_expiry_date', false, false );\n\n\t\t\tform_input_div.append( time_period );\n\n\t\t\ttime_period.setValue( value );\n\n\t\t\t$this.initSourceData( 'skill_expiry_date', time_period );\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\t$this.visible_report_widgets.skill_expiry_date = time_period;\n\n\t\t}\n\n\t\tfunction buildCustomDateUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_skill_expiry_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'skill_expiry_date', false, false );\n\t\t\t$this.initSourceData( 'skill_expiry_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar start_date = $this.getDatePicker( 'start_date_2' );\n\n\t\t\tvar end_date = $this.getDatePicker( 'end_date_2' );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tstart_date.setValue( defaultValue.start_date );\n\t\t\t\tend_date.setValue( defaultValue.end_date );\n\t\t\t}\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( start_date, $.i18n._( 'Start Date' ) );\n\t\t\tvar form_item3 = $this.putInputToInsideFormItem( end_date, $.i18n._( 'End Date' ) );\n\n\t\t\t$this.visible_report_widgets.skill_expiry_date = time_period;\n\t\t\t$this.visible_report_widgets.start_date_2 = start_date;\n\t\t\t$this.visible_report_widgets.end_date_2 = end_date;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tstart_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tend_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t}\n\t}\n\n\tonMembershipRenewalDateChange( target, defaultValue ) {\n\n\t\tvar $this = this;\n\t\tvar value = target.getValue();\n\n\t\tthis.visible_report_widgets.membership_renewal_date = null;\n\t\tthis.visible_report_widgets.start_date_1 = null;\n\t\tthis.visible_report_widgets.end_date_1 = null;\n\t\tthis.visible_report_widgets.pay_period_id_1 = null;\n\t\tthis.visible_report_widgets.pay_period_schedule_id_1 = null;\n\n\t\tif ( value === 'custom_date' ) {\n\t\t\tbuildCustomDateUI();\n\t\t} else if ( value === 'custom_pay_period' ) {\n\t\t\tbuildPayPeriodUI();\n\t\t} else if ( value === 'this_pay_period' || value === 'last_pay_period' || value === 'to_last_pay_period' || value === 'to_this_pay_period' ) {\n\t\t\tbuildPayPeriodScheduleUI();\n\t\t} else {\n\t\t\tbuildDefaultUI();\n\t\t}\n\n\t\tfunction buildPayPeriodScheduleUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_membership_renewal_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'membership_renewal_date', false, false );\n\t\t\t$this.initSourceData( 'membership_renewal_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_schedule_id_1', 'global_pay_period_schedule', TTAPI.APIPayPeriodSchedule );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period Schedule' ) );\n\n\t\t\t$this.visible_report_widgets.membership_renewal_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_schedule_id_1 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_schedule_id );\n\t\t\t}\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 120 );\n\n\t\t\tform_input_div.append( v_box );\n\t\t}\n\n\t\tfunction buildPayPeriodUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_membership_renewal_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'membership_renewal_date', false, false );\n\t\t\t$this.initSourceData( 'membership_renewal_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_id_1', 'global_Pay_period', TTAPI.APIPayPeriod );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period' ) );\n\n\t\t\t$this.visible_report_widgets.membership_renewal_date = time_period;\n\t\t\t$this.visible_report_widgets.pay_period_id_1 = pay_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_id );\n\t\t\t}\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t}\n\n\t\tfunction buildDefaultUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_membership_renewal_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'membership_renewal_date', false, false );\n\n\t\t\tform_input_div.append( time_period );\n\n\t\t\ttime_period.setValue( value );\n\n\t\t\t$this.initSourceData( 'membership_renewal_date', time_period );\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\t$this.visible_report_widgets.membership_renewal_date = time_period;\n\n\t\t}\n\n\t\tfunction buildCustomDateUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_membership_renewal_date_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( 'membership_renewal_date', false, false );\n\t\t\t$this.initSourceData( 'membership_renewal_date', time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar start_date = $this.getDatePicker( 'start_date_1' );\n\n\t\t\tvar end_date = $this.getDatePicker( 'end_date_1' );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tstart_date.setValue( defaultValue.start_date );\n\t\t\t\tend_date.setValue( defaultValue.end_date );\n\t\t\t}\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( start_date, $.i18n._( 'Start Date' ) );\n\t\t\tvar form_item3 = $this.putInputToInsideFormItem( end_date, $.i18n._( 'End Date' ) );\n\n\t\t\t$this.visible_report_widgets.membership_renewal_date = time_period;\n\t\t\t$this.visible_report_widgets.start_date_1 = start_date;\n\t\t\t$this.visible_report_widgets.end_date_1 = end_date;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tstart_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tend_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 62 );\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t}\n\t}\n\n\tonTimePeriodChange( target, defaultValue ) {\n\t\tvar $this = this;\n\t\tvar value = target.getValue();\n\t\tvar field = target.getField();\n\t\tthis.visible_report_widgets[field] = null;\n\n\t\tif ( value === 'custom_date' ) {\n\t\t\tbuildCustomDateUI();\n\t\t} else if ( value === 'custom_pay_period' ) {\n\t\t\tbuildPayPeriodUI();\n\t\t} else if ( value === 'this_pay_period' || value === 'last_pay_period' || value === 'to_last_pay_period' || value === 'to_this_pay_period' || value === 'this_year_this_pay_period' || value === 'this_year_last_pay_period' ) {\n\t\t\tbuildPayPeriodScheduleUI();\n\t\t} else {\n\t\t\tbuildDefaultUI();\n\t\t}\n\n\t\tfunction buildPayPeriodScheduleUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_' + field + '_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( field, false, false );\n\t\t\t$this.initSourceData( field, time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_schedule_id', 'global_pay_period_schedule', TTAPI.APIPayPeriodSchedule );\n\t\t\tpay_period.attr( 'time_period_key', field );\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period Schedule' ) );\n\n\t\t\t$this.visible_report_widgets[field] = time_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_schedule_id );\n\t\t\t}\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 120 );\n\n\t\t\tform_input_div.append( v_box );\n\t\t}\n\n\t\tfunction buildPayPeriodUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_' + field + '_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( field, false, false );\n\t\t\t$this.initSourceData( field, time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar pay_period = $this.getTComboBox( 'pay_period_id', 'global_Pay_period', TTAPI.APIPayPeriod );\n\t\t\tpay_period.attr( 'time_period_key', field );\n\t\t\tpay_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( pay_period, $.i18n._( 'Pay Period' ) );\n\n\t\t\t$this.visible_report_widgets[field] = time_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tpay_period.setValue( defaultValue.pay_period_id );\n\t\t\t}\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 70 );\n\n\t\t}\n\n\t\tfunction buildDefaultUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_' + field + '_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( field, false, false );\n\n\t\t\tform_input_div.append( time_period );\n\n\t\t\ttime_period.setValue( value );\n\n\t\t\t$this.initSourceData( field, time_period );\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\t$this.visible_report_widgets[field] = time_period;\n\n\t\t}\n\n\t\tfunction buildCustomDateUI() {\n\t\t\tvar form_item_div = ( $this.edit_view ).find( '#report_' + field + '_div' );\n\t\t\tvar form_input_div = $( form_item_div.children()[1] );\n\t\t\tform_input_div.empty();\n\n\t\t\tvar v_box = $( '
' );\n\n\t\t\tvar time_period = $this.getSimpleTComboBox( field, false, false );\n\t\t\t$this.initSourceData( field, time_period );\n\t\t\ttime_period.setValue( value );\n\n\t\t\tvar start_date = $this.getDatePicker( 'start_date' );\n\t\t\tvar end_date = $this.getDatePicker( 'end_date' );\n\t\t\tstart_date.attr( 'time_period_key', field );\n\t\t\tend_date.attr( 'time_period_key', field );\n\n\t\t\tif ( defaultValue ) {\n\t\t\t\tstart_date.setValue( defaultValue.start_date );\n\t\t\t\tend_date.setValue( defaultValue.end_date );\n\t\t\t}\n\n\t\t\tvar form_item = $this.putInputToInsideFormItem( time_period, $.i18n._( 'Section' ) );\n\t\t\tvar form_item2 = $this.putInputToInsideFormItem( start_date, $.i18n._( 'Start Date' ) );\n\t\t\tvar form_item3 = $this.putInputToInsideFormItem( end_date, $.i18n._( 'End Date' ) );\n\n\t\t\t$this.visible_report_widgets[field] = time_period;\n\n\t\t\ttime_period.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tstart_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tend_date.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target ) {\n\t\t\t\t$this.onFormItemChange( target );\n\t\t\t} );\n\n\t\t\tv_box.append( form_item );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '
' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '
' );\n\n\t\t\t$this.setEditFieldSize( v_box.find( '.edit-view-form-item-sub-label-div > span' ), 62 );\n\n\t\t\tform_input_div.append( v_box );\n\n\t\t}\n\t}\n\n\t//Override this if more than one tab\n\tsetErrorTips( result, dont_switch_tab ) {\n\t\tthis.clearErrorTips();\n\n\t\tvar details = result.getDetails();\n\t\tvar error_list = details[0];\n\n\t\tvar found_in_current_tab = false;\n\n\t\tvar tab_report = this.edit_view_tab.find( '#tab_report' );\n\t\tvar tab_setup = this.edit_view_tab.find( '#tab_setup' );\n\n\t\tfor ( var key in error_list ) {\n\n\t\t\tif ( !error_list.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.edit_view_ui_dic[key] ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( key === 'time_period' ||\n\t\t\t\tkey === 'membership_renewal_date' ||\n\t\t\t\tkey === 'skill_expiry_date' ||\n\t\t\t\tkey === 'license_expiry_date' ||\n\t\t\t\tkey === 'education_graduate_date'\n\t\t\t) {\n\t\t\t\tif ( this.visible_report_widgets[key] && this.visible_report_widgets[key].is( ':visible' ) ) {\n\t\t\t\t\tthis.visible_report_widgets[key].setErrorStyle( error_list[key], true );\n\t\t\t\t\tfound_in_current_tab = true;\n\t\t\t\t} else if ( this.visible_report_widgets[key] ) {\n\t\t\t\t\tthis.visible_report_widgets[key].setErrorStyle( error_list[key] );\n\t\t\t\t}\n\t\t\t\tthis.edit_view_error_ui_dic[key] = this.visible_report_widgets[key];\n\t\t\t} else {\n\t\t\t\tif ( this.edit_view_ui_dic[key].is( ':visible' ) ) {\n\n\t\t\t\t\tthis.edit_view_ui_dic[key].setErrorStyle( error_list[key], true );\n\t\t\t\t\tfound_in_current_tab = true;\n\n\t\t\t\t} else {\n\n\t\t\t\t\tthis.edit_view_ui_dic[key].setErrorStyle( error_list[key] );\n\t\t\t\t}\n\t\t\t\tthis.edit_view_error_ui_dic[key] = this.edit_view_ui_dic[key];\n\t\t\t}\n\n\t\t}\n\n\t\tif ( !found_in_current_tab ) {\n\n\t\t\tthis.showEditViewError( result );\n\n\t\t}\n\t}\n\n\tbuildSortSelectorUnSelectColumns( display_columns ) {\n\t\tvar fina_array = [];\n\t\tvar i = 100;\n\t\t$.each( display_columns, function( index, content ) {\n\t\t\tvar new_content = $.extend( {}, content );\n\t\t\tnew_content.id = i; //Need\n\t\t\tnew_content.sort = 'asc';\n\t\t\tfina_array.push( new_content );\n\t\t\ti = i + 1;\n\t\t} );\n\n\t\treturn fina_array;\n\t}\n\n\tsetEditViewWidgetsMode() {\n\t\tvar did_clean_dic = {};\n\t\tfor ( var key in this.edit_view_ui_dic ) {\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\twidget.css( 'opacity', 1 );\n\t\t\tvar column = widget.parent().parent().parent();\n\t\t\tvar tab_id = column.parent().attr( 'id' );\n\t\t\tif ( !column.hasClass( 'v-box' ) ) {\n\t\t\t\tif ( !did_clean_dic[tab_id] ) {\n\t\t\t\t\tdid_clean_dic[tab_id] = true;\n\t\t\t\t}\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( widget.setEnabled ) ) {\n\t\t\t\t\twidget.setEnabled( true );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tbuildReportUIBaseOnSetupFields() {\n\t\tvar setup_field = this.current_edit_record.setup_field;\n\t\tif ( setup_field && setup_field.length > 0 ) {\n\t\t\tthis.createUI( setup_field );\n\t\t}\n\t}\n\n\tgetFormValues() {\n\t\tvar other = {};\n\n\t\tother.page_orientation = this.current_edit_record.page_orientation;\n\t\tother.font_size = this.current_edit_record.font_size;\n\t\tother.auto_refresh = this.current_edit_record.auto_refresh;\n\t\tother.disable_grand_total = this.current_edit_record.disable_grand_total;\n\t\tother.maximum_page_limit = this.current_edit_record.maximum_page_limit;\n\t\tother.show_duplicate_values = this.current_edit_record.show_duplicate_values;\n\n\t\tif ( this.current_saved_report && _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.current_saved_report.name ) ) {\n\n\t\t\tother.report_name = this.current_saved_report.name;\n\t\t\tother.report_description = this.current_saved_report.description;\n\t\t}\n\n\t\treturn other;\n\t}\n\n\tgetChartValues() {\n\n\t\tvar chart = {};\n\n\t\tchart.enable = this.current_edit_record.enable;\n\t\tchart.display_mode = this.current_edit_record.display_mode;\n\t\tchart.type = this.current_edit_record.type;\n\t\tchart.include_sub_total = this.current_edit_record.include_sub_total;\n\t\tchart.axis_scale_static = this.current_edit_record.axis_scale_static;\n\t\tchart.combine_columns = this.current_edit_record.combine_columns;\n\n\t\treturn chart;\n\t}\n\n\tconvertSortValues( sort ) {\n\n\t\tvar result = [];\n\t\tfor ( var i = 0; i < sort.length; i++ ) {\n\t\t\tvar item = sort[i];\n\n\t\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( item.fullValue ) ) {\n\t\t\t\tresult = sort;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tvar new_item = {};\n\t\t\t\tnew_item[item.value] = item.sort;\n\t\t\t\tresult.push( new_item );\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}\n\n\taddOrderFix( report ) {\n\n\t\tvar new_report_fields = {};\n\n\t\tfor ( var key in report ) {\n\n\t\t\tif ( !report.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tvar order_fix = this.visible_report_widgets_order_fix[key];\n\n\t\t\tif ( order_fix > 0 ) {\n\t\t\t\tnew_report_fields['-' + order_fix + '-' + key] = report[key];\n\t\t\t}\n\t\t}\n\n\t\treturn new_report_fields;\n\t}\n\n\t//Make sure this.current_edit_record is updated before validate\n\tvalidate( synchronous ) {\n\t\tvar $this = this;\n\t\tvar other = this.getFormValues();\n\t\tvar chart = this.getChartValues();\n\n\t\t//#2293 - Refresh the report tab UI based on any changes to chart or setup tabs, or changes that hide and show fields will not validate properly.\n\t\tthis.buildReportUIBaseOnSetupFields();\n\n\t\tvar report = this.visible_report_values;\n\t\tif ( report.sort ) {\n\t\t\treport.sort = this.convertSortValues( report.sort );\n\t\t}\n\n\t\treport = this.addOrderFix( report );\n\n\t\tvar config = report;\n\t\tconfig['-' + 1000 + '-' + 'template'] = this.current_edit_record.template;\n\t\tconfig.other = other;\n\t\tconfig.chart = chart;\n\n\t\tif ( this.include_form_setup ) {\n\t\t\tconfig.form = this.getFormSetupData( true );\n\t\t}\n\n\t\tif ( report.sort ) {\n\t\t\treport.sort = this.convertSortValues( report.sort );\n\t\t}\n\n\t\tif ( !synchronous ) {\n\t\t\tthis.api['validateReport']( config, 'pdf', {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.validateResult( result );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\treturn null;\n\t\t} else {\n\t\t\t//#2293 - synchronous call to validation api allows us to return the value in realtime\n\t\t\tvar result = this.api['validateReport']( config, 'pdf', { async: false } );\n\t\t\tif ( result ) {\n\t\t\t\tthis.validateResult( result );\n\n\t\t\t\treturn result.getResult();\n\t\t\t}\n\t\t}\n\t}\n\n\tonViewExcelClick( message_override ) {\n\n\t\tvar config = this.getPostReportJson();\n\t\tvar post_data = { 0: config, 1: 'csv' };\n\n\t\tif ( this.include_form_setup ) {\n\n\t\t\tif ( this.show_empty_message ) {\n\t\t\t\tvar message = $.i18n._( 'Setup data for this report has not been completed yet. Please click on the Form Setup tab to do so now.' );\n\t\t\t\tif ( message_override ) {\n\t\t\t\t\tmessage = message_override;\n\t\t\t\t}\n\t\t\t\tTAlertManager.showAlert( message );\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconfig.form = this.getFormSetupData( true );\n\t\t}\n\n\t\tthis.doFormIFrameCall( post_data );\n\n\t\tvar source = 'Excel'; // Backup value in case the url sm does not exist.\n\t\tif ( LocalCacheData.getAllURLArgs() && LocalCacheData.getAllURLArgs().sm ) {\n\t\t\tsource = LocalCacheData.getAllURLArgs().sm + '@Excel';\n\t\t}\n\t\t$().TFeedback( {\n\t\t\tsource: source,\n\t\t\tforce_source: true,\n\t\t\tdelay: 5000\n\t\t} );\n\t}\n\n\tgetVisibleReportValues() {\n\t\t//#2353 - cut out any zero uuid strings, they are likely --none-- in a multiselect\n\t\tfor ( var i in this.visible_report_values.filter ) {\n\t\t\tif ( this.visible_report_values.filter[i] == TTUUID.zero_id ) {\n\t\t\t\tdelete this.visible_report_values.filter[i];\n\t\t\t}\n\t\t}\n\t\treturn this.visible_report_values;\n\t}\n\n\tgetPostReportJson( noPreFix ) {\n\t\tvar other = this.getFormValues();\n\t\tvar chart = this.getChartValues();\n\t\tvar report = this.getVisibleReportValues();\n\n\t\tif ( report.sort ) {\n\t\t\treport.sort = this.convertSortValues( report.sort );\n\n\t\t\tif ( noPreFix ) { //no pre fix means save to userReport, use sort_ to match flex format\n\t\t\t\treport.sort_ = report.sort;\n\n\t\t\t\tdelete report.sort;\n\t\t\t}\n\n\t\t}\n\n\t\tif ( !noPreFix ) {\n\t\t\treport = this.addOrderFix( report );\n\t\t}\n\n\t\tvar config = report;\n\t\tif ( !noPreFix ) {\n\t\t\tconfig['-' + 1000 + '-' + 'template'] = this.current_edit_record.template;\n\t\t} else {\n\t\t\tconfig['template'] = this.current_edit_record.template;\n\t\t}\n\n\t\tconfig.other = other;\n\t\tconfig.chart = chart;\n\n\t\treturn config;\n\t}\n\n\t//Reports don't share many icons with other views, so override the entire function here.\n\tonContextMenuClick( context_btn, menu_name ) {\n\t\tProgressBar.showOverlay();\n\t\t//this flag is turned off in ProgressBarManager::closeOverlay, or 2s whichever happens first\n\t\tif ( window.clickProcessing == true ) {\n\t\t\treturn;\n\t\t} else {\n\t\t\twindow.clickProcessing = true;\n\t\t\twindow.clickProcessingHandle = window.setTimeout( function() {\n\t\t\t\tif ( window.clickProcessing == true ) {\n\t\t\t\t\twindow.clickProcessing = false;\n\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\tTTPromise.wait();\n\t\t\t\t}\n\t\t\t}, 1000 );\n\t\t}\n\t\tvar id;\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( menu_name ) ) {\n\t\t\tid = menu_name;\n\t\t} else {\n\n\t\t\tif ( context_btn.disabled ) {\n\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\tswitch ( id ) {\n\t\t\tcase 'view':\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.onViewClick();\n\t\t\t\tbreak;\n\t\t\tcase 'view_html':\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.onViewClick( 'html' );\n\t\t\t\tbreak;\n\t\t\tcase 'view_html_new_window':\n\t\t\t\tProgressBar.showOverlay();\n\t\t\t\tthis.onViewClick( 'html', true );\n\t\t\t\tbreak;\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onViewExcelClick();\n\t\t\t\tbreak;\n\t\t\tcase 'cancel':\n\t\t\t\tthis.onCancelClick();\n\t\t\t\tbreak;\n\t\t\tcase 'save_existed_report': //All report view\n\t\t\t\tthis.onSaveExistedReportClick();\n\t\t\t\tbreak;\n\t\t\tcase 'save_new_report': //All report view\n\t\t\t\tthis.onSaveNewReportClick();\n\t\t\t\tbreak;\n\t\t\tcase 'save_setup': //All report view\n\t\t\t\tthis.onSaveSetup();\n\t\t\t\tbreak;\n\t\t\tcase 'view_form': //All report view\n\t\t\t\tthis.onViewClick( 'pdf_form' );\n\t\t\t\tbreak;\n\t\t\tcase 'e_file': //All report view\n\t\t\t\tthis.onViewClick( 'efile' );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_view': //All report view\n\t\t\t\tthis.onViewClick( 'pdf_timesheet' );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_view_detail': //All report view\n\t\t\t\tthis.onViewClick( 'pdf_timesheet_detail' );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\tthis.onCustomContextClick( id, context_btn );\n\t\t\t\tbreak;\n\t\t}\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.triggerAnalyticsContextMenuClick */ .x.triggerAnalyticsContextMenuClick( context_btn, menu_name );\n\t}\n\n\tonSaveSetup( label ) {\n\t\tvar $this = this;\n\t\tvar form_setup = this.getFormSetupData();\n\n\t\tif ( label == undefined ) {\n\t\t\tlabel = $.i18n._( 'Form setup' );\n\t\t}\n\n\t\t//Allows saving of all export config data for all export formats at once in PayrollExport\n\t\tif ( this.save_export_setup_data != undefined ) {\n\t\t\tform_setup = this.save_export_setup_data;\n\t\t}\n\n\t\t//do this before the api call for speed to stop #\n\t\t$this.show_empty_message = false;\n\t\t$this.form_setup_changed = false;\n\n\t\tif ( form_setup ) { //Don't save if form_setup is false.\n\t\t\tthis.api.setCompanyFormConfig( form_setup, {\n\t\t\t\tonResult: function( result ) {\n\n\t\t\t\t\tif ( result.isValid() ) {\n\n\t\t\t\t\t\tTAlertManager.showAlert( label + ' ' + $.i18n._( 'has been saved successfully' ) );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.show_empty_message = true;\n\t\t\t\t\t\t$this.form_setup_changed = true;\n\t\t\t\t\t\tTAlertManager.showAlert( label + ' ' + $.i18n._( 'save failed, please try again' ) );\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tTAlertManager.showAlert( label + ' ' + $.i18n._( 'invalid, please try again' ) );\n\t\t}\n\t}\n\n\tgetFormSetupData() {\n\t\t//Always need override\n\t}\n\n\tonViewClick( key, new_window, message_override ) {\n//\t\tGlobal.loadPage('temp_page.html',function(result){\n//\t\t\tIndexViewController.openizard( 'ReportViewWizard', result);\n//\t\t});\n\t\tif ( !key ) {\n\t\t\tkey = 'pdf';\n\t\t}\n\n\t\t//#2293 - make validation call synchronously to stop the report from being shown if it fails.\n\t\tif ( !this.validate( true ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar config = this.getPostReportJson();\n\t\tvar post_data = { 0: config, 1: key };\n\t\tif ( this.include_form_setup ) {\n\t\t\tif ( this.show_empty_message ) {\n\t\t\t\tvar message = $.i18n._( 'Setup data for this report has not been completed yet. Please click on the Form Setup tab to do so now.' );\n\t\t\t\tif ( message_override ) {\n\t\t\t\t\tmessage = message_override;\n\t\t\t\t}\n\t\t\t\tTAlertManager.showAlert( message );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tconfig.form = this.getFormSetupData( true );\n\t\t}\n\n//\t\tif ( key === 'pdf' ) {\n//\t\t\tthis.doFormIFrameCall( post_data );\n//\t\t}\n\t\tif ( key === 'html' ) {\n\t\t\tvar url = ServiceCaller.getAPIURL( 'Class=' + this.api.className + '&Method=' + 'get' + this.api.key_name + '&v=2' );\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getStationID */ .x.getStationID() ) {\n\t\t\t\turl = url + '&StationID=' + _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getStationID */ .x.getStationID();\n\t\t\t}\n\t\t\tvar message_id = TTUUID.generateUUID();\n\t\t\turl = url + '&MessageID=' + message_id;\n\n\t\t\tvar refresh_request = '