TimeTrex/interface/html5/dist/reports-ReportBaseViewController.bundle.js

1 line
340 KiB
JavaScript

"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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = $( '<div class=\\'v-box\\'></div>' );\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( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item2 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\n\t\t\tv_box.append( form_item3 );\n\t\t\tv_box.append( '<div class=\\'clear-both-div\\'></div>' );\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 = '<script>';\n\t\t\trefresh_request += 'function getCookie( name ) {';\n\t\t\trefresh_request += '\tvar name = name + \"=\";';\n\t\t\trefresh_request += '\tvar split_cookie = document.cookie.split( \";\" );';\n\t\t\trefresh_request += '\tfor ( var i = 0; i < split_cookie.length; i++ ) {';\n\t\t\trefresh_request += '\t\tvar tmp_cookie = split_cookie[i].trim();';\n\t\t\trefresh_request += '';\n\t\t\trefresh_request += '\t\tif ( tmp_cookie.indexOf( name ) === 0 ) {';\n\t\t\trefresh_request += '\t\t\treturn tmp_cookie.substring( name.length, tmp_cookie.length );';\n\t\t\trefresh_request += '\t\t}';\n\t\t\trefresh_request += '\t}';\n\t\t\trefresh_request += '\treturn \"\"';\n\t\t\trefresh_request += '}';\n\t\t\trefresh_request += '';\n\t\t\trefresh_request += 'var timeout_handler;';\n\t\t\trefresh_request += 'var post_data;';\n\t\t\trefresh_request += 'function startRefreshReport() {';\n\t\t\trefresh_request += '\tif ( typeof( auto_refresh_time ) !== \"undefined\" && auto_refresh_time > 0 ) {';\n\t\t\trefresh_request += '\t\ttimeout_handler = setTimeout( \"refreshReport()\", ( auto_refresh_time * 1000 ) );';\n\t\t\trefresh_request += '\t}';\n\t\t\trefresh_request += '}';\n\t\t\trefresh_request += '';\n\t\t\trefresh_request += 'function refreshReport() {';\n\t\t\trefresh_request += '\ttry {';\n\t\t\trefresh_request += '\t\t$.ajax({';\n\t\t\trefresh_request += '\t\t\tdataType: \"JSON\",';\n\t\t\trefresh_request += '\t\t\tdata: { json: JSON.stringify( post_data ) },';\n\t\t\trefresh_request += ' headers: { \"X-Client-ID\": \"Browser-TimeTrex\", \"X-CSRF-Token\": getCookie( \"CSRF-Token\" ) },';\n\t\t\trefresh_request += '\t\t\ttype: \"POST\",';\n\t\t\trefresh_request += ' url: \"' + url + '\",';\n\t\t\trefresh_request += '\t\t\tsuccess: function(result) {';\n\t\t\trefresh_request += '\t\t\tif(console){ console.log( \"Auto refreshing report: Seconds: \"+ auto_refresh_time +\" Current Time: \"+ Date() ) }';\n\t\t\trefresh_request += '\t\t\tvar newDoc = result.api_retval + $(\"body\").children(\":last\")[0].outerHTML; document.open(\"text/html\"); document.write(newDoc); document.close(); ';\n\t\t\trefresh_request += '\t\t\t}';\n\t\t\trefresh_request += '\t\t})';\n\t\t\trefresh_request += '\t} catch(e) {}';\n\t\t\trefresh_request += '}';\n\t\t\trefresh_request += 'startRefreshReport();';\n\t\t\trefresh_request += '';\n\t\t\trefresh_request += '$( \"body\" ).mousemove( function( e ) {';\n\t\t\trefresh_request += '\twindow.parent.Global.doPingIfNecessary()';\n\t\t\trefresh_request += '} );';\n\t\t\trefresh_request += '<\/script>';\n\n\t\t\tthis.api['get' + this.api.key_name]( config, key, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tvar result = res.getResult();\n\t\t\t\t\tif ( result ) {\n\t\t\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isEmpty */ .x.isEmpty( result ) === false ) {\n\t\t\t\t\t\t\tresult = result + refresh_request;\n\t\t\t\t\t\t\tif ( new_window ) {\n\t\t\t\t\t\t\t\tvar w = window.open();\n\t\t\t\t\t\t\t\tw.post_data = post_data;\n\t\t\t\t\t\t\t\tw.document.writeln( result );\n\t\t\t\t\t\t\t\tw.document.close();\n\t\t\t\t\t\t\t} else if ( result ) {\n\t\t\t\t\t\t\t\tvar report_data = { post_data: post_data, result: result };\n\t\t\t\t\t\t\t\tIndexViewController.openWizard( 'ReportViewWizard', report_data );\n\t\t\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'NO DATA MATCHES CRITERIA', LocalCacheData.getApplicationName() ), $.i18n._( 'NOTICE' ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTAlertManager.showErrorAlert( res );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( key === 'pdf_form_publish_employee' ) {\n\t\t\tthis.api['get' + this.api.key_name]( config, key, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar retval = result.getResult();\n\t\t\t\t\tif ( retval ) {\n\t\t\t\t\t\tUserGenericStatusWindowController.open( retval, LocalCacheData.getLoginUser().id, function() {\n\t\t\t\t\t\t} );\n\t\t\t\t\t\tProgressBar.closeOverlay();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tTAlertManager.showAlert( $.i18n._( 'NO DATA MATCHES CRITERIA', LocalCacheData.getApplicationName() ), $.i18n._( 'NOTICE' ) );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tthis.doFormIFrameCall( post_data );\n\t\t\tProgressBar.closeOverlay();\n\n\t\t\tvar source = 'PDF'; // Backup value in case the url sm does not exist.\n\t\t\tif ( LocalCacheData.getAllURLArgs() && LocalCacheData.getAllURLArgs().sm ) {\n\t\t\t\tsource = LocalCacheData.getAllURLArgs().sm + '@PDF';\n\t\t\t}\n\t\t\t$().TFeedback( {\n\t\t\t\tsource: source,\n\t\t\t\tforce_source: true,\n\t\t\t\tdelay: 5000\n\t\t\t} );\n\t\t}\n\t}\n\n\tprocessTransactions( key ) {\n\t\tvar args = this.getPostReportJson( true );\n\t\tvar post_data = { 0: { filter_data: args }, 1: true, 2: key };\n\t\tvar pay_stub_api = TTAPI.APIPayStub;\n\t\tvar url = ServiceCaller.getAPIURL( 'Class=' + pay_stub_api.className + '&Method=' + 'get' + pay_stub_api.key_name );\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.APIFileDownload */ .x.APIFileDownload( pay_stub_api.className, pay_stub_api.key_name, post_data, url );\n\t}\n\n\tsetEditMenuViewIcon( context_btn, pId ) {\n\t}\n\n\tdoFormIFrameCall( postData ) {\n\n\t\tvar url = ServiceCaller.getAPIURL( 'Class=' + this.api.className + '&Method=' + 'get' + this.api.key_name );\n\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.APIFileDownload */ .x.APIFileDownload( this.api.className, this.api.key_name, postData, url );\n\t}\n\n\tonSaveNewReportClick() {\n\t\tvar $this = this;\n\t\tvar config = this.getPostReportJson( true );\n\t\tvar select_field = this.current_edit_record.setup_field;\n\n\t\tif ( config.template ) {\n\t\t\tselect_field.unshift( 'template' );\n\t\t}\n\n\t\tvar report_data = {};\n\t\treport_data.data = {};\n\t\treport_data.data.config = config;\n\t\treport_data.data.template = select_field;\n\t\treport_data.script = this.script_name;\n\n\t\tif ( !this.sub_saved_report_view_controller ) {\n\t\t\tthis.initSubSavedReportView( function() {\n\t\t\t\t$this.sub_saved_report_view_controller.edit_only_mode = true;\n\t\t\t\t$this.sub_saved_report_view_controller.onAddClick( report_data );\n\t\t\t} );\n\t\t} else {\n\t\t\t$this.sub_saved_report_view_controller.edit_only_mode = true;\n\t\t\t$this.sub_saved_report_view_controller.buildContextMenu( true );\n\t\t\t$this.sub_saved_report_view_controller.onAddClick( report_data );\n\t\t}\n\t}\n\n\tonSaveExistedReportClick() {\n\t\tvar $this = this;\n\t\tvar config = this.getPostReportJson( true );\n\t\tvar select_field = this.current_edit_record.setup_field;\n\n\t\tif ( config.template ) {\n\t\t\tselect_field.unshift( 'template' );\n\t\t}\n\n\t\tvar report_data = this.current_saved_report;\n\n\t\tif ( !report_data ) {\n\t\t\treport_data = {};\n\t\t}\n\n\t\treport_data.data = {};\n\t\treport_data.data.config = config;\n\t\treport_data.data.template = select_field;\n\n\t\tif ( !report_data.script ) {\n\t\t\treport_data.script = this.script_name;\n\t\t}\n\n\t\tif ( !this.sub_saved_report_view_controller ) {\n\t\t\tthis.initSubSavedReportView( function() {\n\t\t\t\t$this.sub_saved_report_view_controller.edit_only_mode = true;\n\t\t\t\t$this.sub_saved_report_view_controller.onAddClick( report_data );\n\t\t\t} );\n\t\t} else {\n\t\t\t$this.sub_saved_report_view_controller.edit_only_mode = true;\n\t\t\t$this.sub_saved_report_view_controller.buildContextMenu( true );\n\t\t\t$this.sub_saved_report_view_controller.onAddClick( report_data );\n\t\t}\n\t}\n\n\tonSaveDoneCallback( result, current_edit_record ) {\n\t\tvar new_id = result.getResult();\n\n\t\tif ( TTUUID.isUUID( new_id ) == false && current_edit_record && current_edit_record.id ) {\n\t\t\tnew_id = current_edit_record.id;\n\t\t}\n\t\tthis.refreshNav( new_id );\n\t}\n\n\trefreshNav( newId ) {\n\n\t\tvar $this = this;\n\n\t\tthis.navigation.setSourceData( null );\n\n\t\t$this.getReportData( function( result ) {\n\t\t\t// Waiting for the TTAPI.API returns data to set the current edit record.\n\n\t\t\tif ( result && result.length > 0 ) {\n\n\t\t\t\tif ( TTUUID.isUUID( newId ) ) {\n\t\t\t\t\tfor ( var i = 0; i < result.length; i++ ) {\n\t\t\t\t\t\tvar item = result[i];\n\n\t\t\t\t\t\tif ( item.id === newId ) {\n\t\t\t\t\t\t\t$this.current_saved_report = result[i];\n\t\t\t\t\t\t\tbreak;\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.current_saved_report = $this.getDefaultReport( result );\n\t\t\t\t}\n\n\t\t\t\t$this.saved_report_array = result;\n\t\t\t} else {\n\t\t\t\t$this.current_saved_report = null;\n\t\t\t\t$this.saved_report_array = [];\n\t\t\t}\n\n\t\t\t$this.current_edit_record = {};\n\t\t\t$this.visible_report_values = {};\n\n\t\t\t$this.initEditView();\n\n\t\t} );\n\t}\n\n\tprocessFormSetupDataAndAddToBatch( response_data, form_data_map ) {\n\t\t//This is used to group form setup data by API so that we can do a single API call instead of one for every field.\n\t\t//The API call retrieves the real form data that is displayed when a dropdown has only one record. Data with more than 1 record or with no API\n\t\t//is set immediately as they do not require data from the server. Otherwise this returns an array of batched record IDs\n\t\t//that will be sent to the server with getBatchedRealFormDataFromAPI().\n\t\tlet batch_get_real_data = {};\n\t\tif ( response_data ) {\n\t\t\tfor ( let i = 0; i < form_data_map.length; i++ ) {\n\t\t\t\tif ( form_data_map[i].data && typeof form_data_map[i].data === 'object' && form_data_map[i].api ) {\n\t\t\t\t\tfor ( let key in form_data_map[i].data ) {\n\t\t\t\t\t\tlet field_name = form_data_map[i].field_key + '_' + key;\n\t\t\t\t\t\tif ( form_data_map[i].api && form_data_map[i].data[key] !== false && form_data_map[i].api && form_data_map[i].data[key].length === 1 ) {\n\t\t\t\t\t\t\tif ( !batch_get_real_data[form_data_map[i].api.className] ) {\n\t\t\t\t\t\t\t\tbatch_get_real_data[form_data_map[i].api.className] = {\n\t\t\t\t\t\t\t\t\tmethod: form_data_map[i].api_method,\n\t\t\t\t\t\t\t\t\trecords: []\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbatch_get_real_data[form_data_map[i].api.className].records.push( {\n\t\t\t\t\t\t\t\tfield: field_name,\n\t\t\t\t\t\t\t\tid: form_data_map[i].data[key][0]\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[field_name].setValue( form_data_map[i].data[key] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthis.current_edit_record[field_name] = form_data_map[i].data[key];\n\t\t\t\t\t}\n\t\t\t\t} else if ( form_data_map[i].data !== undefined ) {\n\t\t\t\t\tthis.edit_view_ui_dic[form_data_map[i].field_key].setValue( form_data_map[i].data );\n\t\t\t\t\tthis.current_edit_record[form_data_map[i].field_key] = form_data_map[i].data;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn batch_get_real_data;\n\t}\n\n\tgetBatchedRealFormDataFromAPI( batch_data ) {\n\t\tif ( Object.keys( batch_data ).length > 0 ) {\n\t\t\tlet $this = this;\n\t\t\tfor ( let api in batch_data ) {\n\t\t\t\tlet data = {};\n\t\t\t\t//Get paystub entry account ids and remove duplicate values\n\t\t\t\tdata.filter_data = {\n\t\t\t\t\tid: _.uniq( batch_data[api].records.map( ( obj ) => {\n\t\t\t\t\t\treturn obj.id;\n\t\t\t\t\t} ) )\n\t\t\t\t};\n\n\t\t\t\tTTAPI[api][batch_data[api].method]( data, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\tlet result = res.getResult();\n\n\t\t\t\t\t\tif ( result && Array.isArray( result ) ) {\n\t\t\t\t\t\t\t//Loop through batch not api results, as results will not contain duplicate values\n\t\t\t\t\t\t\t//which would result in skipping setting fields that have the duplicate account entry id selected.\n\t\t\t\t\t\t\tfor ( let i = 0; i < batch_data[api].records.length; i++ ) {\n\t\t\t\t\t\t\t\tlet result_data = result.find( data => data.id === batch_data[api].records[i].id );\n\t\t\t\t\t\t\t\t//Issue #3130 - Deleted records that are still set on the field would cause an error. Do not set undefined to the field.\n\t\t\t\t\t\t\t\tif ( result_data !== undefined ) {\n\t\t\t\t\t\t\t\t\tif ( $this.edit_view_ui_dic[batch_data[api].records[i].field].getAllowMultipleSelection() === true ) {\n\t\t\t\t\t\t\t\t\t\t$this.edit_view_ui_dic[batch_data[api].records[i].field].setValue( [result_data] );\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t$this.edit_view_ui_dic[batch_data[api].records[i].field].setValue( result );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\t//#2543 - fixing disconnected menu leading to page_orientation JavaScript exception\n\t//This caused a bug that if you go to Dashboard, then Report -> TimeSheet Report, then click the X at the top right, the ribbon menu would get out of sync and have the last \"Help\" top level menu selected.\n\t// onCloseIconClick: function() {\n\t// \tif ( LocalCacheData.current_open_sub_controller ) {\n\t// \t\tLocalCacheData.current_open_sub_controller.onCancelClick();\n\t// \t} else {\n\t// \t\tvar $this = this;\n\t// \t\tthis.onCancelClick( null, null, function() {\n\t// \t\t\tif ( !this.edit_view ) {\n\t// \t\t\t\t$this.parent_view_controller.buildContextMenu();\n\t// \t\t\t\t$this.parent_view_controller.setDefaultMenu();\n\t// \t\t\t\t//$this.onCancelClick();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