"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["home-dashlet-DashletController"],{190:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DashletController\": () => (/* binding */ DashletController)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\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 DashletController extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tdata: null,\n\t\t\tapi_dashboard: null,\n\t\t\tapi_user_report: null,\n\t\t\tuser_generic_data_api: null,\n\t\t\tall_columns: null,\n\t\t\tgrid: null,\n\t\t\tdashboard_data: null,\n\t\t\trefresh_timer: null,\n\t\t\tiframe_data: null,\n\t\t\tinitComplete: false,\n\t\t\tiframe: null,\n\t\t\thomeViewController: null,\n\t\t\tinitTimesheetGridComplete: null,\n\t\t\taccumulated_total_grid_source_map: null,\n\t\t\taccmulated_order_map: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\t\tthis.api_dashboard = TTAPI.APIDashboard;\n\t\tthis.user_generic_data_api = TTAPI.APIUserGenericData;\n\t}\n\n\trefreshIfNecessary() {\n\t\tif ( this.data && this.data.data.dashlet_type == 'custom_report' || this.data.data.dashlet_type === 'news' ) {\n\t\t\tif ( this.iframe_data ) {\n\t\t\t\tthis.addIframeBack();\n\t\t\t\tthis.setIframeData();\n\t\t\t}\n\t\t}\n\t}\n\n\tinitContent() {\n\t\tvar $this = this;\n\t\tthis.setTitle();\n\t\tthis.initComplete = false;\n\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isScrolledIntoView */ .x.isScrolledIntoView( $( $this.el ) ) ) {\n\t\t\tdoInit();\n\t\t}\n\n\t\t//BUG#2070 - Disable resizable for mobile because it negatively impacts usability\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.detectMobileBrowser */ .x.detectMobileBrowser() == false ) {\n\t\t\t$( '#' + $( this.el ).attr( 'id' ) ).resizable( {\n\t\t\t\thandles: 'all',\n\t\t\t\tstart: function( e, ui ) {\n\t\t\t\t},\n\t\t\t\tresize: function( e, ui ) {\n\t\t\t\t\t$this.setGridSize();\n\t\t\t\t},\n\t\t\t\tstop: function( e, ui ) {\n\t\t\t\t\t$this.addIframeBack();\n\t\t\t\t\tvar height = Math.round( ui[\"element\"][0].offsetHeight / 10 ) * 10; //Snap to nearest 10px\n\t\t\t\t\tvar width = Math.round( ui[\"element\"][0].offsetWidth / $( '.dashboard-container' ).width() * 100 ); //Snap nearest whole integer\n\n\t\t\t\t\t//We perform math on the width value that we save, because of that we need to set the div to that value too.\n\t\t\t\t\t//This should help prevent differences in width the users see while resizing their dashlets and after refreshing.\n\t\t\t\t\tui[\"element\"][0].style.height = height + 'px';\n\t\t\t\t\tui[\"element\"][0].style.width = width + '%';\n\n\t\t\t\t\t$this.saveSize( height, width );\n\n\t\t\t\t\t$this.homeViewController.updateLayout();\n\t\t\t\t\t$this.homeViewController.dashboard_container.masonry( 'reloadItems' );\n\t\t\t\t},\n\t\t\t} );\n\t\t\t//$( '#' + $( this.el ).attr( 'id' ) ).resizable( 'option', 'handles','all' );\n\t\t}\n\n\t\tthis.homeViewController.dashboard_container.parent().scroll( function() {\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isScrolledIntoView */ .x.isScrolledIntoView( $( $this.el ) ) && !$this.initComplete ) {\n\t\t\t\tdoInit();\n\t\t\t}\n\t\t} );\n\n\t\tfunction doInit() {\n\t\t\tif ( $this.data.data.dashlet_type == 'custom_list' ) {\n\t\t\t\t$( $this.el ).addClass( 'custom_list' );\n\t\t\t\t$this.initCustomViewContent();\n\t\t\t} else if ( $this.data.data.dashlet_type == 'custom_report' ) {\n\t\t\t\t$( $this.el ).addClass( 'custom-report' );\n\t\t\t\t$this.initReportContent();\n\t\t\t\t//DO NOT call .unbind here, as it breaks resizing dashlets at the very bottom that have to be scrolled into view by overwriting jquery-ui mousedown events\n\t\t\t\t$( $this.el ).bind( 'mousedown', function() {\n\t\t\t\t\t$this.removeIframe();\n\t\t\t\t} );\n\t\t\t\t$( $this.el ).bind( 'mouseup', function() {\n\t\t\t\t\t$this.addIframeBack();\n\t\t\t\t} );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'request_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'request-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'request_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'request_authorize_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'request-authorize-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'request_authorize_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'accrual_balance_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'accrual-balance-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'accrual_balance_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'exception_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'exception-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'exception_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'exception_summary_child' ) {\n\t\t\t\t$( $this.el ).addClass( 'exception-summary-child' );\n\t\t\t\t$this.initDefaultDashletContent( 'exception_summary_child' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'message_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'message-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'message_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'user_active_shift_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'user-active-shift-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'user_active_shift_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'timesheet_verification_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'timesheet-verification-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'timesheet_verification_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'timesheet_verification_summary_child' ) {\n\t\t\t\t$( $this.el ).addClass( 'timesheet-verification_summary-child' );\n\t\t\t\t$this.initDefaultDashletContent( 'timesheet_verification_summary_child' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'timesheet_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'timesheet-summary' );\n\t\t\t\t$this.initTimesheetContent( 'timesheet_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'schedule_summary' ) {\n\t\t\t\t$( $this.el ).addClass( 'schedule-summary' );\n\t\t\t\t$this.initDefaultDashletContent( 'schedule_summary' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'schedule_summary_child' ) {\n\t\t\t\t$( $this.el ).addClass( 'schedule-summary-child' );\n\t\t\t\t$this.initDefaultDashletContent( 'schedule_summary_child' );\n\t\t\t} else if ( $this.data.data.dashlet_type == 'news' ) {\n\t\t\t\t$( $this.el ).addClass( 'news' );\n\t\t\t\t$this.initNewsContent();\n\t\t\t\t$( $this.el ).unbind( 'mousedown' ).bind( 'mousedown', function() {\n\t\t\t\t\t$this.removeIframe();\n\t\t\t\t} );\n\t\t\t\t$( $this.el ).unbind( 'mouseup' ).bind( 'mouseup', function() {\n\t\t\t\t\t$this.addIframeBack();\n\n\t\t\t\t} );\n\t\t\t}\n\t\t\t$this.initComplete = true;\n\t\t}//if not android\n\t}\n\n\tonViewClick() {\n\t\tvar target_view = '';\n\t\tvar open_reoprt = false;\n\t\tif ( this.data.data.dashlet_type == 'custom_list' ) {\n\t\t\ttarget_view = this.data.data.view_name;\n\t\t\tif ( target_view === 'Request-Authorization' ) {\n\t\t\t\ttarget_view = 'RequestAuthorization';\n\t\t\t} else if ( target_view === 'PayPeriodTimeSheetVerify' ) {\n\t\t\t\ttarget_view = 'TimeSheetAuthorization';\n\t\t\t} else if ( target_view === 'UserExpense-Authorization' ) {\n\t\t\t\ttarget_view = 'ExpenseAuthorization';\n\t\t\t} else if ( target_view === 'User' ) {\n\t\t\t\ttarget_view = 'Employee';\n\t\t\t} else if ( target_view === 'Transaction' ) {\n\t\t\t\ttarget_view = 'InvoiceTransaction';\n\t\t\t} else if ( target_view === 'UserWage' ) {\n\t\t\t\ttarget_view = 'Wage';\n\t\t\t}\n\t\t} else {\n\t\t\tswitch ( this.data.data.dashlet_type ) {\n\t\t\t\tcase 'message_summary':\n\t\t\t\t\ttarget_view = 'MessageControl';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'exception_summary_child':\n\t\t\t\tcase 'exception_summary':\n\t\t\t\t\ttarget_view = 'Exception';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'schedule_summary':\n\t\t\t\tcase 'schedule_summary_child':\n\t\t\t\t\ttarget_view = 'Schedule';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'request_summary':\n\t\t\t\t\ttarget_view = 'Request';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'timesheet_verification_summary':\n\t\t\t\t\topen_reoprt = true;\n\t\t\t\t\ttarget_view = 'TimesheetSummaryReport';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'timesheet_verification_summary_child':\n\t\t\t\t\topen_reoprt = true;\n\t\t\t\t\ttarget_view = 'TimesheetSummaryReport';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'timesheet_summary':\n\t\t\t\t\ttarget_view = 'TimeSheet';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'user_active_shift_summary':\n\t\t\t\t\topen_reoprt = true;\n\t\t\t\t\ttarget_view = 'ActiveShiftReport';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'request_authorize_summary':\n\t\t\t\t\ttarget_view = 'RequestAuthorization';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'accrual_balance_summary':\n\t\t\t\t\ttarget_view = 'AccrualBalance';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif ( open_reoprt ) {\n\t\t\tIndexViewController.openReport( this.homeViewController, target_view );\n\t\t} else {\n\t\t\tIndexViewController.goToView( target_view );\n\t\t}\n\t}\n\n\tonCellFormat( cell_value, related_data, row ) {\n\t\tcell_value = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.decodeCellValue */ .x.decodeCellValue( cell_value );\n\t\tvar col_model = related_data.colModel;\n\t\tvar row_id = related_data.rowid;\n\t\tvar content_div = $( '
' );\n\t\tvar punch_info;\n\t\tif ( related_data.pos === 0 ) {\n\t\t\tif ( row.type === DashletController.TOTAL_ROW ) {\n\t\t\t\tpunch_info = $( '' );\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( cell_value ) ) {\n\t\t\t\t\tpunch_info.text( cell_value );\n\t\t\t\t} else {\n\t\t\t\t\tpunch_info.text( '' );\n\t\t\t\t}\n\t\t\t\treturn punch_info.get( 0 ).outerHTML;\n\t\t\t} else if ( row.type === DashletController.REGULAR_ROW ) {\n\n\t\t\t\tpunch_info = $( '' );\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( cell_value ) ) {\n\t\t\t\t\tpunch_info.text( cell_value );\n\t\t\t\t} else {\n\t\t\t\t\tpunch_info.text( '' );\n\t\t\t\t}\n\t\t\t\treturn punch_info.get( 0 ).outerHTML;\n\t\t\t}\n\t\t\treturn cell_value;\n\t\t}\n\t\tvar ex_span;\n\t\tvar i;\n\t\tvar time_span;\n\t\tvar punch;\n\t\tvar break_span;\n\t\tvar related_punch;\n\t\tvar exception;\n\t\tvar len;\n\t\tvar text;\n\t\tvar ex;\n\t\tvar data;\n\t\tif ( row.type === DashletController.TOTAL_ROW ) {\n\t\t\tdata = row[col_model.name + '_data'];\n\t\t\ttime_span = $( '' );\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( cell_value ) ) {\n\t\t\t\tif ( data ) {\n\t\t\t\t\tif ( data.hasOwnProperty( 'override' ) && data.override === true ) {\n\t\t\t\t\t\ttime_span.addClass( 'absence-override' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( data.hasOwnProperty( 'note' ) && data.note ) {\n\t\t\t\t\t\tcell_value = '*' + cell_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttime_span.text( cell_value );\n\n\t\t\t} else {\n\t\t\t\ttime_span.text( '' );\n\t\t\t}\n\t\t\tcontent_div.prepend( time_span );\n\t\t} else if ( row.type === DashletController.REGULAR_ROW ) {\n\t\t\tcontent_div.addClass( 'top-line' );\n\t\t\tdata = row[col_model.name + '_data'];\n\t\t\ttime_span = $( '' );\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( cell_value ) ) {\n\t\t\t\tif ( data ) {\n\t\t\t\t\tif ( data.hasOwnProperty( 'override' ) && data.override === true ) {\n\t\t\t\t\t\ttime_span.addClass( 'absence-override' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( data.hasOwnProperty( 'note' ) && data.note ) {\n\t\t\t\t\t\tcell_value = '*' + cell_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttime_span.text( cell_value );\n\t\t\t} else {\n\t\t\t\ttime_span.text( '' );\n\t\t\t}\n\t\t\tcontent_div.prepend( time_span );\n\t\t} else if ( row.type === DashletController.ACCUMULATED_TIME_ROW ) {\n\t\t\tdata = row[col_model.name + '_data'];\n\t\t\ttime_span = $( '' );\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( cell_value ) ) {\n\t\t\t\tif ( data ) {\n\t\t\t\t\tif ( data.hasOwnProperty( 'override' ) && data.override === true ) {\n\t\t\t\t\t\ttime_span.addClass( 'absence-override' );\n\t\t\t\t\t}\n\t\t\t\t\tif ( data.hasOwnProperty( 'note' ) && data.note ) {\n\t\t\t\t\t\tcell_value = '*' + cell_value;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttime_span.text( cell_value );\n\t\t\t} else {\n\t\t\t\ttime_span.text( '' );\n\t\t\t}\n\t\t\tcontent_div.prepend( time_span );\n\t\t} else {\n\t\t\ttime_span = $( '' );\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( cell_value ) ) {\n\t\t\t\ttime_span.text( cell_value );\n\t\t\t} else {\n\t\t\t\ttime_span.text( '' );\n\t\t\t}\n\t\t\tcontent_div.prepend( time_span );\n\t\t}\n\t\treturn content_div.get( 0 ).outerHTML;\n\t}\n\n\tinitNewsContent() {\n\t\tvar $this = this;\n\t\t$( this.el ).find( '#grid' ).remove();\n\t\t$( this.el ).find( '.view-btn' ).remove();\n\t\t$( this.el ).find( '.refresh-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$( e.target ).addClass( 'button-rotate' );\n\t\t\t$this.initNewsData();\n\t\t} );\n\t\tthis.initNewsData();\n\t\tthis.startRefresh();\n\t}\n\n\tinitNewsData() {\n\t\tvar $this = this;\n\t\tthis.api_dashboard.getDashletData( this.data.data.dashlet_type, {}, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result = result.getResult();\n\t\t\t\t$this.iframe_data = result;\n\t\t\t\tif ( result ) {\n\t\t\t\t\t$this.removeNoResultCover();\n\n\t\t\t\t\t$this.setIframeData();\n\t\t\t\t} else {\n\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t}\n\t\t\t\t$( '.button-rotate' ).removeClass( 'button-rotate' );\n\t\t\t}\n\t\t} );\n\t}\n\n\t//Error: Uncaught TypeError: Cannot read property 'contentDocument' of undefined in/interface/html5/#!m=MessageControl line 359\n\tsetIframeData( iframe_data ) {\n\t\tif ( $( this.el ).find( '#iframe' ).length > 0 && $( this.el ).find( '#iframe' )[0].contentWindow.document ) {\n\t\t\t$( this.el ).find( '#iframe' )[0].contentWindow.document.open();\n\t\t\t$( this.el ).find( '#iframe' )[0].contentWindow.document.writeln( this.iframe_data );\n\t\t\t$( this.el ).find( '#iframe' )[0].contentWindow.document.close();\n\t\t}\n\t}\n\n\tinitTimesheetContent( view_name ) {\n\t\t$( this.el ).find( '#iframe' ).remove();\n\t\tvar $this = this;\n\t\tthis.api = this.getAPIByViewName( view_name );\n\t\t// set grid id\n\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.grid ) || !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.grid.grid ) ) {\n\t\t\tvar grid = $( this.el ).find( '#grid' );\n\t\t\tgrid.attr( 'id', 'dashlet_' + this.data.id + '_grid' ); //Grid's id is ScriptName + _grid\n\t\t}\n\t\t// refresh event\n\t\t$( this.el ).find( '.refresh-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$( e.target ).addClass( 'button-rotate' );\n\t\t\t$this.initDefaultTimesheetData();\n\t\t} );\n\t\t// view event\n\t\t$( this.el ).find( '.view-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this.onViewClick();\n\t\t} );\n\n\t\t// start load grid data\n\t\tthis.initDefaultTimesheetData();\n\t\tthis.startRefresh();\n\t}\n\n\tinitDefaultTimesheetData() {\n\t\tvar $this = this;\n\t\tthis.accumulated_total_grid_source_map = {};\n\t\tthis.api.getTimeSheetData( LocalCacheData.getLoginUser().id, new Date().format(), {\n\t\t\tonResult: function( result ) {\n\t\t\t\t//Error: Uncaught TypeError: Cannot read property 'start_display_date' of undefined in /interface/html5/#!m=Home line 409\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t$this.full_timesheet_data = result.getResult();\n\t\t\t\t\t$this.pay_period_data = $this.full_timesheet_data.pay_period_data;\n\t\t\t\t\t$this.timesheet_verify_data = $this.full_timesheet_data.timesheet_verify_data;\n\t\t\t\t\tif ( $this.full_timesheet_data.timesheet_dates ) {\n\t\t\t\t\t\t$this.start_date = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.strToDate */ .x.strToDate( $this.full_timesheet_data.timesheet_dates.start_display_date );\n\t\t\t\t\t\t$this.end_date = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.strToDate */ .x.strToDate( $this.full_timesheet_data.timesheet_dates.end_display_date );\n\t\t\t\t\t\t// Error: Uncaught TypeError: Cannot read property 'format' of null in interface/html5/#!m=Home line 607\n\t\t\t\t\t\tif ( !$this.initTimesheetGridComplete && $this.start_date && $this.end_date ) {\n\t\t\t\t\t\t\t$this.buildAccumulatedTotalGrid();\n\t\t\t\t\t\t\t$this.initTimesheetGridComplete = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.buildAccumulatedTotalData();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t}\n\n\t\t\t\t$( '.button-rotate' ).removeClass( 'button-rotate' );\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildAccmulatedOrderMap( total ) {\n\t\tif ( !total ) {\n\t\t\treturn;\n\t\t}\n\t\tfor ( var key in total ) {\n\t\t\tfor ( var key1 in total[key] ) {\n\t\t\t\tthis.accmulated_order_map[key1] = total[key][key1].order;\n\t\t\t}\n\t\t}\n\t}\n\n\tbuildAccumulatedTotalData() {\n\t\t// There will be no grid when no start date and end date when calling getTimeSheetData\n\t\tif ( !this.grid ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.accmulated_order_map = {};\n\t\tthis.accumulated_total_grid_source = [];\n\t\tvar accumulated_user_date_total_data = this.full_timesheet_data.accumulated_user_date_total_data;\n\t\tvar pay_period_accumulated_user_date_total_data = this.full_timesheet_data.pay_period_accumulated_user_date_total_data;\n\t\tvar accumulated_time = pay_period_accumulated_user_date_total_data.accumulated_time;\n\t\tvar premium_time = pay_period_accumulated_user_date_total_data.premium_time;\n\t\tvar absence_time = pay_period_accumulated_user_date_total_data.absence_time_taken;\n\t\t// Save the order, will do sort after all data prepared.\n\t\tif ( accumulated_user_date_total_data.total ) {\n\t\t\tthis.buildAccmulatedOrderMap( accumulated_user_date_total_data.total );\n\t\t}\n\t\tif ( pay_period_accumulated_user_date_total_data ) {\n\t\t\tthis.buildAccmulatedOrderMap( pay_period_accumulated_user_date_total_data );\n\t\t}\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( accumulated_time ) ) {\n\t\t\tthis.buildSubGridsData( accumulated_time, 'pay_period', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'accumulated_time' );\n\t\t} else {\n\t\t\taccumulated_time = { total: { label: 'Total Time', total_time: '0' } };\n\t\t\tthis.buildSubGridsData( accumulated_time, 'pay_period', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'accumulated_time' );\n\t\t}\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( premium_time ) ) {\n\t\t\tthis.buildSubGridsData( premium_time, 'pay_period', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'premium_time' );\n\t\t}\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( absence_time ) ) {\n\t\t\tthis.buildSubGridsData( absence_time, 'pay_period', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'absence_time' );\n\t\t}\n\t\taccumulated_time = { total: { label: 'Total Time', total_time: '0' } };\n\t\tthis.buildSubGridsData( accumulated_time, 'week', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'accumulated_time' );\n\t\tfor ( var key in accumulated_user_date_total_data ) {\n\t\t\t//Build Accumulated Total Grid week column data\n\t\t\tif ( key === 'total' ) {\n\t\t\t\tvar total_result = accumulated_user_date_total_data.total;\n\t\t\t\taccumulated_time = total_result.accumulated_time;\n\t\t\t\tpremium_time = total_result.premium_time;\n\t\t\t\tabsence_time = total_result.absence_time_taken;\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( accumulated_time ) ) {\n\t\t\t\t\tthis.buildSubGridsData( accumulated_time, 'week', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'accumulated_time' );\n\t\t\t\t}\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( premium_time ) ) {\n\t\t\t\t\tthis.buildSubGridsData( premium_time, 'week', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'premium_time' );\n\t\t\t\t}\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( absence_time ) ) {\n\t\t\t\t\tthis.buildSubGridsData( absence_time, 'week', this.accumulated_total_grid_source_map, this.accumulated_total_grid_source, 'absence_time' );\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\t\tthis.sortAccumulatedTotalData();\n\t\tthis.grid.setData( this.accumulated_total_grid_source );\n\t}\n\n\tsortAccumulatedTotalData() {\n\t\tvar sort_fields = ['order', 'punch_info'];\n\t\tthis.accumulated_total_grid_source.sort( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.m_sort_by */ .x.m_sort_by( sort_fields ) );\n\t}\n\n\tbuildSubGridsData( array, date_string, map, result_array, parent_key ) {\n\t\tvar row;\n\t\tvar marked_regular_row = false; //Only mark the first regular time row, as thats where the bold top-line is going to go.\n\t\tfor ( var key in array ) {\n\t\t\tif ( !map[key] ) {\n\t\t\t\trow = {};\n\t\t\t\trow.parent_key = parent_key;\n\t\t\t\trow.key = key;\n\n\t\t\t\tif ( parent_key === 'accumulated_time' ) {\n\n\t\t\t\t\tif ( key === 'total' || key === 'worked_time' ) {\n\t\t\t\t\t\trow.type = DashletController.TOTAL_ROW;\n\t\t\t\t\t} else if ( marked_regular_row == false && key.indexOf( 'regular_time' ) === 0 ) {\n\t\t\t\t\t\trow.type = DashletController.REGULAR_ROW;\n\t\t\t\t\t\tmarked_regular_row = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\trow.type = DashletController.ACCUMULATED_TIME_ROW;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( array[key].override ) {\n\t\t\t\t\t\trow.is_override_row = true;\n\t\t\t\t\t}\n\n\t\t\t\t} else if ( parent_key === 'premium_time' ) {\n\t\t\t\t\trow.type = DashletController.PREMIUM_ROW;\n\t\t\t\t}\n\n\t\t\t\tif ( this.accmulated_order_map[key] ) {\n\t\t\t\t\trow.order = this.accmulated_order_map[key];\n\t\t\t\t}\n\n\t\t\t\trow.punch_info = array[key].label;\n\n\t\t\t\tvar key_array = key.split( '_' );\n\t\t\t\tvar no_id = false;\n\t\t\t\tif ( key_array.length > 1 && key_array[1] == '0' ) {\n\t\t\t\t\tno_id = true;\n\t\t\t\t}\n\n\t\t\t\tarray[key].key = key;\n\t\t\t\trow[date_string] = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getTimeUnit */ .x.getTimeUnit( array[key].total_time );\n\t\t\t\trow[date_string + '_data'] = array[key];\n\n\t\t\t\t//if id == 0, put the row as first row.\n\t\t\t\tif ( no_id ) {\n\t\t\t\t\tresult_array.unshift( row );\n\t\t\t\t} else {\n\t\t\t\t\tresult_array.push( row );\n\t\t\t\t}\n\n\t\t\t\tmap[key] = row;\n\t\t\t} else {\n\t\t\t\trow = map[key];\n\t\t\t\tif ( row[date_string] && key === 'total' ) { //Override total cell data since we set all to 00:00 at beginning\n\t\t\t\t\tarray[key].key = key;\n\t\t\t\t\trow[date_string] = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getTimeUnit */ .x.getTimeUnit( array[key].total_time );\n\t\t\t\t\trow[date_string + '_data'] = array[key];\n\n\t\t\t\t\tif ( row.parent_key === 'accumulated_time' ) {\n\t\t\t\t\t\tif ( array[key].override ) {\n\t\t\t\t\t\t\trow.is_override_row = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tarray[key].key = key;\n\t\t\t\t\trow[date_string] = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getTimeUnit */ .x.getTimeUnit( array[key].total_time );\n\t\t\t\t\trow[date_string + '_data'] = array[key];\n\n\t\t\t\t\tif ( row.parent_key === 'accumulated_time' ) {\n\t\t\t\t\t\tif ( array[key].override ) {\n\t\t\t\t\t\t\trow.is_override_row = true;\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\tgetAccumulatedTotalGridPayperiodHeader() {\n\t\tthis.pay_period_header = $.i18n._( 'No Pay Period' );\n\t\tvar pay_period_id = this.timesheet_verify_data.pay_period_id;\n\t\tif ( pay_period_id && this.pay_period_data ) {\n\t\t\tfor ( var key in this.pay_period_data ) {\n\t\t\t\tvar pay_period = this.pay_period_data[key];\n\t\t\t\tif ( pay_period.id === pay_period_id ) {\n\t\t\t\t\tvar start_date = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.strToDate */ .x.strToDate( pay_period.start_date ).format();\n\t\t\t\t\tvar end_date = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.strToDate */ .x.strToDate( pay_period.end_date ).format();\n\t\t\t\t\tthis.pay_period_header = start_date + ' to ' + end_date;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tbuildAccumulatedTotalGrid() {\n\t\tvar $this = this;\n\t\tvar columns = [];\n\t\tvar grid_id;\n\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.grid ) ) {\n\t\t\tgrid_id = 'dashlet_' + this.data.id + '_grid';\n\t\t}\n\t\tvar punch_in_out_column = {\n\t\t\tname: 'punch_info',\n\t\t\tindex: 'punch_info',\n\t\t\tlabel: ' ',\n\t\t\twidth: 200,\n\t\t\tsortable: false,\n\t\t\ttitle: false,\n\t\t\tformatter: this.onCellFormat\n\t\t};\n\t\tcolumns.push( punch_in_out_column );\n\t\tvar start_date_str = this.start_date.format( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getLoginUserDateFormat */ .x.getLoginUserDateFormat() );\n\t\tvar end_date_str = this.end_date.format( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.getLoginUserDateFormat */ .x.getLoginUserDateFormat() );\n\t\tthis.getAccumulatedTotalGridPayperiodHeader();\n\t\tvar column_1 = {\n\t\t\tname: 'week',\n\t\t\tindex: 'week',\n\t\t\tlabel: $.i18n._( 'Week' ) + '
' + start_date_str + ' to ' + end_date_str,\n\t\t\twidth: 100,\n\t\t\tsortable: false,\n\t\t\ttitle: false,\n\t\t\tformatter: this.onCellFormat\n\t\t};\n\t\tvar column_2 = {\n\t\t\tname: 'pay_period',\n\t\t\tindex: 'pay_period',\n\t\t\tlabel: $.i18n._( 'Pay Period' ) + '
' + this.pay_period_header,\n\t\t\twidth: 100,\n\t\t\tsortable: false,\n\t\t\ttitle: false,\n\t\t\tformatter: this.onCellFormat\n\t\t};\n\t\tcolumns.push( column_1 );\n\t\tcolumns.push( column_2 );\n\t\tvar grid_data = {};\n\t\tif ( !this.grid ) { //#2571 - this.grid.jqGrid is not a function\n\t\t\tgrid_data = {\n\n\t\t\t\tmultiselectPosition: 'none',\n\t\t\t\tgridComplete: function() {\n\t\t\t\t\tif ( $( this ).jqGrid( 'getGridParam', 'data' ).length > 0 ) {\n\t\t\t\t\t\t$this.setGridColumnsWidth();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t} else {\n\t\t\tgrid_data = {\n\t\t\t\tshrinkToFit: false\n\t\t\t}; //use the defaults\n\t\t}\n\n\t\tthis.grid = new TTGrid( grid_id, grid_data, columns );\n\n\t\t$this.setGridSize();\n\t}\n\n\tinitDefaultDashletContent( view_name ) {\n\t\t$( this.el ).find( '#iframe' ).remove();\n\t\tvar $this = this;\n\t\tthis.api = this.getAPIByViewName( view_name );\n\t\t// when auto resize\n\t\t$( window ).off( 'resize.dashlet_content' ).on( 'resize.dashlet_content', function() {\n\t\t\tif ( $this.grid ) {\n\t\t\t\t$this.setGridSize();\n\t\t\t}\n\t\t} );\n\t\t// set grid id\n\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.grid ) ) {\n\t\t\tvar grid = $( this.el ).find( '#grid' );\n\t\t\tgrid.attr( 'id', 'dashlet_' + this.data.id + '_grid' ); //Grid's id is ScriptName + _grid\n\t\t}\n\t\t// refresh event\n\t\t$( this.el ).find( '.refresh-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$( e.target ).addClass( 'button-rotate' );\n\t\t\t$this.initDefaultDashletData();\n\t\t} );\n\t\t// view event\n\t\t$( this.el ).find( '.view-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this.onViewClick();\n\t\t} );\n\n\t\t// start load grid data\n\t\tthis.initDefaultDashletData();\n\t\tthis.startRefresh();\n\t}\n\n\tinitDefaultDashletData() {\n\t\tvar $this = this;\n\t\t$this.getDefaultDashletData( function() {\n\t\t\t$this.getAllColumns( function() {\n\t\t\t\t$this.setSelectLayout();\n\t\t\t\tvar data = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.formatGridData */ .x.formatGridData( $this.dashboard_data.data, $this.data.data.dashlet_type );\n\t\t\t\tdata = $this.processId( data );\n\t\t\t\tif ( $this.grid ) {\n\t\t\t\t\t$this.grid.setData( data );\n\t\t\t\t}\n\t\t\t\t$( '.button-rotate' ).removeClass( 'button-rotate' );\n\t\t\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isArray */ .x.isArray( $this.dashboard_data.data ) || $this.dashboard_data.data.length < 1 ) {\n\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t} else {\n\t\t\t\t\t$this.removeNoResultCover();\n\t\t\t\t}\n\t\t\t\t$this.setGridCellBackGround();\n\t\t\t} );\n\t\t} );\n\t}\n\n\tprocessId( data ) {\n\t\tvar start_id = -2;\n\t\t// Add a random id to make sure each row has different id when the item don't have id itself (Scheudle summary)\n\t\tdata = _.map( data, function( item ) {\n\t\t\tif ( item.hasOwnProperty( 'id' ) && ( !item.id || item.id == TTUUID.zero_id ) ) {\n\t\t\t\titem.id = start_id;\n\t\t\t}\n\t\t\tstart_id--;\n\t\t\treturn item;\n\t\t} );\n\n\t\treturn data;\n\t}\n\n\taddIframeBack() {\n\t\tvar $this = this;\n\t\tif ( $this.iframe ) {\n\t\t\t$( $this.el ).find( '.content' ).append( $this.iframe );\n\t\t\t$this.setIframeData();\n\t\t\t$this.iframe = null;\n\t\t}\n\t}\n\n\tremoveIframe() {\n\t\tvar $this = this;\n\t\t$this.iframe = $( $this.el ).find( '#iframe' );\n\t\t$( $this.el ).find( '#iframe' ).remove();\n\t}\n\n\tsaveSize( h, w ) {\n\t\tthis.data.data.width = w;\n\t\tthis.data.data.height = h;\n\t\tthis.user_generic_data_api.setUserGenericData( this.data, {\n\t\t\tonResult: function( result ) {\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetGridSize() {\n\t\tif ( ( !this.grid || !this.grid.grid || !this.grid.grid.is( ':visible' ) ) ) {\n\t\t\treturn;\n\t\t}\n\t\tthis.grid.grid.setGridWidth( $( this.el ).find( '.content' ).width() );\n\t\tthis.grid.grid.setGridHeight( $( this.el ).find( '.content' ).height() - 28 );\n\t}\n\n\tinitReportContent() {\n\t\tvar $this = this;\n\t\t$( this.el ).find( '#grid' ).remove();\n\t\t$( this.el ).find( '.view-btn' ).remove();\n\t\t$( this.el ).find( '.refresh-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$( e.target ).addClass( 'button-rotate' );\n\t\t\t$this.initReportData();\n\t\t} );\n\t\tthis.api_user_report = TTAPI.APIUserReportData;\n\t\tthis.api = this.getAPIByViewName( this.data.data.report );\n\t\tthis.initReportData();\n\t\tthis.startRefresh();\n\t}\n\n\tcleanWhenUnloadView() {\n\t\tif ( this.refresh_timer ) {\n\t\t\tclearInterval( this.refresh_timer );\n\t\t}\n\t}\n\n\tinitReportData() {\n\t\tvar $this = this;\n\t\tif ( $this.data.data.template !== 'saved_report' ) {\n\t\t\tvar report_api = this.getAPIByViewName( this.data.data.report );\n\t\t\treport_api.getTemplate( $this.data.data.template, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar config = result.getResult();\n\t\t\t\t\tconfig.other = {\n\t\t\t\t\t\t'page_orientation': 'P',\n\t\t\t\t\t\t'font_size': 0,\n\t\t\t\t\t\t'auto_refresh': false,\n\t\t\t\t\t\t'disable_grand_total': false,\n\t\t\t\t\t\t'maximum_page_limit': 100,\n\t\t\t\t\t\t'show_duplicate_values': false,\n\t\t\t\t\t\tis_embedded: true\n\t\t\t\t\t};\n\t\t\t\t\t$this.api['get' + $this.api.key_name]( config, 'html', {\n\t\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\t\tvar result = res.getResult();\n\t\t\t\t\t\t\t$this.iframe_data = result;\n\t\t\t\t\t\t\tif ( result ) {\n\t\t\t\t\t\t\t\t$this.setIframeData();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$( '.button-rotate' ).removeClass( 'button-rotate' );\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} else {\n\t\t\t$this.api_user_report.getUserReportData( {\n\t\t\t\tfilter_data: {\n\t\t\t\t\tid: $this.data.data.saved_report_id\n\t\t\t\t}\n\t\t\t}, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\tif ( result_data && result_data.length == 1 ) {\n\t\t\t\t\t\tif ( result_data[0].data.config.other ) {\n\t\t\t\t\t\t\tresult_data[0].data.config.other.is_embedded = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tresult_data[0].data.config.other = { is_embedded: true };\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.api['get' + $this.api.key_name]( result_data[0].data.config, 'html', {\n\t\t\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\t\t\tvar result = res.getResult();\n\t\t\t\t\t\t\t\t$this.iframe_data = result;\n\t\t\t\t\t\t\t\tif ( result ) {\n\t\t\t\t\t\t\t\t\t$this.setIframeData();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$( '.button-rotate' ).removeClass( 'button-rotate' );\n\t\t\t\t\t\t\t}\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\tstartRefresh() {\n\t\tvar $this = this;\n\t\tvar auto_refresh = this.data.data.auto_refresh;\n\t\tif ( auto_refresh > 0 ) {\n\t\t\tthis.refresh_timer = setInterval( function() {\n\t\t\t\t//Don't refresh dashlets if user is idle for more than 1 minute.\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.idle_time */ .x.idle_time && _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.idle_time */ .x.idle_time > 1 ) { //Idle time is in minutes. -- This is required to prevent refreshing dashlets from keeping the session active indefinitely.\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif ( LocalCacheData.current_open_primary_controller.viewId !== 'Home' ) {\n\t\t\t\t\tclearInterval( $this.refresh_timer );\n\t\t\t\t}\n\t\t\t\tif ( $this.data.data.dashlet_type == 'custom_list' ) {\n\t\t\t\t\t$this.initCustomViewData();\n\t\t\t\t} else if ( $this.data.data.dashlet_type == 'custom_report' ) {\n\t\t\t\t\t$this.initReportData();\n\t\t\t\t} else if ( $this.data.data.dashlet_type == 'exception_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'request_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'message_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'exception_summary_child' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'request_authorize_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'accrual_balance_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'user_active_shift_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'timesheet_verification_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'timesheet_verification_summary_child' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'schedule_summary' ||\n\t\t\t\t\t$this.data.data.dashlet_type == 'schedule_summary_child' ) {\n\t\t\t\t\t$this.initDefaultDashletData();\n\t\t\t\t} else if ( $this.data.data.dashlet_type == 'timesheet_summary' ) {\n\t\t\t\t\t$this.initDefaultTimesheetData();\n\t\t\t\t} else if ( $this.data.data.dashlet_type == 'news' ) {\n\t\t\t\t\t$this.initNewsData();\n\t\t\t\t}\n\n\t\t\t}, ( auto_refresh * 1000 ) );\n\t\t}\n\t}\n\n\tinitCustomViewContent() {\n\t\t$( this.el ).find( '#iframe' ).remove();\n\t\tvar $this = this;\n\t\tthis.api = this.getAPIByViewName( this.data.data.view_name );\n\t\t// when auto resize\n\t\t$( window ).off( 'resize.dashlet_custom_content' ).on( 'resize.dashlet_custom_content', function() {\n\t\t\tif ( $this.grid ) {\n\t\t\t\t$this.setGridSize();\n\t\t\t}\n\t\t} );\n\t\t// set grid id\n\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.grid ) ) {\n\t\t\tvar grid = $( this.el ).find( '#grid' );\n\t\t\tgrid.attr( 'id', 'dashlet_' + this.data.id + '_grid' ); //Grid's id is ScriptName + _grid\n\t\t}\n\t\t// refresh event\n\t\t$( this.el ).find( '.refresh-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$( e.target ).addClass( 'button-rotate' );\n\t\t\t$this.initCustomViewData();\n\t\t} );\n\t\t// view event\n\t\t$( this.el ).find( '.view-btn' ).unbind( 'click' ).bind( 'click', function( e ) {\n\t\t\t$this.onViewClick();\n\t\t} );\n\n\t\t// start load grid data\n\t\tthis.initCustomViewData();\n\t\tthis.startRefresh();\n\t}\n\n\tsetGridCellBackGround() {\n\t\tvar data = this.grid.getData();\n\t\tvar len;\n\t\tvar i;\n\t\tvar item;\n\t\tif ( this.data.data.dashlet_type === 'exception_summary' ||\n\t\t\tthis.data.data.dashlet_type === 'exception_summary_child' ) {\n\t\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\t\tif ( !data ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlen = data.length;\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\titem = data[i];\n\t\t\t\tif ( item.exception_background_color ) {\n\t\t\t\t\tvar severity = $( this.el ).find( 'tr[id=\\'' + item.id + '\\']' ).find( 'td[aria-describedby=\"dashlet_' + this.data.id + '_grid_severity\"]' );\n\t\t\t\t\tseverity.css( 'background-color', item.exception_background_color );\n\t\t\t\t\tseverity.css( 'font-weight', 'bold' );\n\t\t\t\t}\n\t\t\t\tif ( item.exception_color ) {\n\t\t\t\t\tvar code = $( this.el ).find( 'tr[id=\\'' + item.id + '\\']' ).find( 'td[aria-describedby=\"dashlet_' + this.data.id + '_grid_exception_policy_type_id\"]' );\n\t\t\t\t\tcode.css( 'color', item.exception_color );\n\t\t\t\t\tcode.css( 'font-weight', 'bold' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( this.data.data.dashlet_type === 'message_summary' ) {\n\t\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\t\tif ( !data ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlen = data.length;\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\titem = data[i];\n\t\t\t\tif ( item.status_id == 10 ) {\n\t\t\t\t\t$( this.el ).find( 'tr[id=\\'' + item.id + '\\'] td' ).css( 'font-weight', 'bold' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( this.data.data.dashlet_type === 'request_summary' ) {\n\t\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\t\tif ( !data ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlen = data.length;\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\titem = data[i];\n\t\t\t\tif ( item.status_id == 30 ) {\n\t\t\t\t\t$( this.el ).find( 'tr[id=\\'' + item.id + '\\']' ).addClass( 'bolder-request' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( this.data.data.dashlet_type === 'user_active_shift_summary' ) {\n\t\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\t\tif ( !data ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlen = data.length;\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\titem = data[i];\n\t\t\t\tif ( item._status_id == 10 ) {\n\t\t\t\t\t$( this.el ).find( 'tr[id=\\'' + item.id + '\\']' ).addClass( 'light-green' );\n\t\t\t\t} else if ( item.status === 'Out' ) {\n\t\t\t\t\t$( this.el ).find( 'tr[id=\\'' + item.id + '\\']' ).addClass( 'light-red' );\n\t\t\t\t}\n\t\t\t}\n\t\t} else if ( this.data.data.dashlet_type === 'schedule_summary' ||\n\t\t\tthis.data.data.dashlet_type === 'schedule_summary_child' ) {\n\t\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\t\tif ( !data ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tlen = data.length;\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\titem = data[i];\n\t\t\t\tif ( item.status_id == 20 ) {\n\t\t\t\t\t$( this.el ).find( 'tr[id=\\'' + item.id + '\\']' ).addClass( 'red-absence' ); //Do not use ids or coloring gets broken by recurring schedules without ids\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tstartCustomViewAutoRefresh() {\n\t\tvar $this = this;\n\t\tvar auto_refresh = this.data.data.auto_refresh;\n\t\tif ( auto_refresh > 0 ) {\n\t\t\tthis.refresh_timer = setInterval( function() {\n\t\t\t\tif ( LocalCacheData.current_open_primary_controller.viewId !== 'Home' ) {\n\t\t\t\t\tclearInterval( $this.refresh_timer );\n\t\t\t\t}\n\t\t\t\t$this.initCustomViewData();\n\t\t\t}, ( auto_refresh * 1000 ) );\n\t\t}\n\t}\n\n\tinitCustomViewData() {\n\t\tvar $this = this;\n\t\t$this.getCustomListDashboardData( function() {\n\t\t\t$this.getAllColumns( function() {\n\t\t\t\t$this.setSelectLayout();\n\t\t\t\t$this.grid.setData( _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.formatGridData */ .x.formatGridData( $this.dashboard_data.data ) );\n\t\t\t\t$( '.button-rotate' ).removeClass( 'button-rotate' );\n\t\t\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isArray */ .x.isArray( $this.dashboard_data.data ) ) {\n\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t} else {\n\t\t\t\t\t$this.removeNoResultCover();\n\t\t\t\t}\n\t\t\t\tTTPromise.wait( null, null, function() {\n\t\t\t\t\t$this.setGridCellBackGround();\n\t\t\t\t} );\n\t\t\t} );\n\t\t} );\n\t}\n\n\tgetCustomListDashboardData( callback ) {\n\t\tvar $this = this;\n\t\tif ( !this.data.data.rows_per_page ) {\n\t\t\tthis.data.data.rows_per_page = 0;\n\t\t}\n\t\tthis.api_dashboard.getDashletData( this.data.data.dashlet_type, {\n\t\t\t'class': this.data.data.view_name,\n\t\t\t'user_generic_data_id': this.data.data.layout_id.toString(),\n\t\t\t'rows_per_page': this.data.data.rows_per_page.toString()\n\t\t}, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t$this.dashboard_data = result_data;\n\t\t\t\tcallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetDefaultDashletData( callback ) {\n\t\tvar $this = this;\n\t\tif ( !this.data.data.rows_per_page ) {\n\t\t\tthis.data.data.rows_per_page = 0;\n\t\t}\n\t\tthis.api_dashboard.getDashletData( this.data.data.dashlet_type, {\n\t\t\t'rows_per_page': this.data.data.rows_per_page.toString()\n\t\t}, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t$this.dashboard_data = result_data;\n\t\t\t\tcallback();\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildDisplayColumns( apiDisplayColumnsArray ) {\n\t\tvar len = this.all_columns.length;\n\t\tvar len1 = apiDisplayColumnsArray ? apiDisplayColumnsArray.length : 0;\n\t\tvar display_columns = [];\n\t\tfor ( var j = 0; j < len1; j++ ) {\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tif ( apiDisplayColumnsArray[j] === this.all_columns[i].value ) {\n\t\t\t\t\tdisplay_columns.push( this.all_columns[i] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn display_columns;\n\t}\n\n\tonGridDblClickRow() {\n\t\tthis.onViewClick();\n\t}\n\n\tsetSelectLayout() {\n\t\tvar $this = this;\n\t\tvar grid_id;\n\t\tif ( !_global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.isSet */ .x.isSet( this.grid ) ) {\n\t\t\tgrid_id = 'dashlet_' + this.data.id + '_grid';\n\t\t\tif ( $( '#' + grid_id ).length > 0 ) {\n\t\t\t\t$( '#' + grid_id ).jqGrid( 'GridUnload' ); // prevent js exception where grid gets detached\n\t\t\t}\n\t\t}\n\t\tvar display_columns = this.buildDisplayColumns( this.dashboard_data.display_columns );\n\t\t//Set Data Grid on List view\n\t\tvar column_info_array = [];\n\t\tvar len = display_columns.length;\n\t\tvar start_from = 0;\n\t\tfor ( var i = start_from; i < len; i++ ) {\n\t\t\tvar view_column_data = display_columns[i];\n\t\t\tvar column_info = {\n\t\t\t\tname: view_column_data.value,\n\t\t\t\tindex: view_column_data.value,\n\t\t\t\tlabel: view_column_data.label,\n\t\t\t\twidth: 100,\n\t\t\t\tsortable: false,\n\t\t\t\ttitle: false\n\t\t\t};\n\t\t\tcolumn_info_array.push( column_info );\n\t\t}\n\n\t\tif ( !this.grid ) { // #2571 -this.grid.jqGrid is not a function\n\t\t\tvar grid_data = {\n\t\t\t\tmultiselectPosition: 'none',\n\t\t\t\tonSelectRow: $.proxy( this.onGridSelectRow, this ),\n\t\t\t\tondblClickRow: function() {\n\t\t\t\t\t$this.onGridDblClickRow();\n\t\t\t\t},\n\t\t\t\tgridComplete: function() {\n\t\t\t\t\tif ( $( this ).jqGrid( 'getGridParam', 'data' ).length > 0 ) {\n\t\t\t\t\t\t$this.setGridColumnsWidth();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tthis.grid = new TTGrid( grid_id, grid_data, column_info_array );\n\t\t}\n\t\t$this.setGridSize();\n\t}\n\n\tshowNoResultCover() {\n\t\tthis.removeNoResultCover();\n\t\tthis.no_result_box = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.loadWidgetByName */ .x.loadWidgetByName( WidgetNamesDic.NO_RESULT_BOX );\n\t\tif ( this.no_result_box ) {\n\t\t\tthis.no_result_box.NoResultBox( {\n\t\t\t\trelated_view_controller: this,\n\t\t\t\tis_new: false,\n\t\t\t\tmessage: this.getNoResultMessage()\n\t\t\t} );\n\t\t\tthis.no_result_box.attr( 'id', 'dashlet_' + this.data.id + '_no_result_box' );\n\t\t\t$( '#dashlet_' + this.data.id + '_no_result_box' ).remove(); //prevent doubleups\n\t\t\tvar grid_div = $( this.el ).find( '.content' );\n\t\t\tgrid_div.append( this.no_result_box );\n\t\t}\n\t}\n\n\tgetNoResultMessage() {\n\t\t//Show result message base on different dashlet type\n\t\tvar result = $.i18n._( 'No Results Found' );\n\t\tswitch ( this.data.data.dashlet_type ) {\n\t\t\tcase 'schedule_summary':\n\t\t\t\tresult = $.i18n._( 'Perhaps if you ask nicely, your supervisor will add a schedule for you?' );\n\t\t\t\tbreak;\n\t\t\tcase 'exception_summary':\n\t\t\t\tresult = $.i18n._( 'No exceptions to correct, great job!' );\n\t\t\t\tbreak;\n\t\t\tcase 'message_summary':\n\t\t\t\tresult = $.i18n._( 'All messages are read, nicely done!' );\n\t\t\t\tbreak;\n\t\t\tcase 'request_summary':\n\t\t\t\tresult = $.i18n._( 'Send a request to your supervisor by clicking Profile -> Requests.' );\n\t\t\t\tbreak;\n\t\t\tcase 'accrual_balance_summary':\n\t\t\t\tresult = $.i18n._( 'No accrual balances at this time.' );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_summary':\n\t\t\t\tresult = $.i18n._( 'Timesheet not available.' );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_verification_summary':\n\t\t\tcase 'timesheet_verification_summary_child':\n\t\t\t\tresult = $.i18n._( 'No timesheets to verify yet.' );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule_summary_child':\n\t\t\t\tresult = $.i18n._( 'Schedules can be added by clicking Schedule -> Schedules.' );\n\t\t\t\tbreak;\n\t\t\tcase 'exception_summary_child':\n\t\t\t\tresult = $.i18n._( 'All exceptions are corrected... You can relax now!' );\n\t\t\t\tbreak;\n\t\t\tcase 'user_active_shift_summary':\n\t\t\t\tresult = $.i18n._( 'No active shifts at this moment.' );\n\t\t\t\tbreak;\n\t\t\tcase 'request_authorize_summary':\n\t\t\t\tresult = $.i18n._( 'All requests are authorized, excellent work!' );\n\t\t\t\tbreak;\n\t\t\tcase 'news':\n\t\t\t\tresult = $.i18n._( 'Slow news day, nothing to see here yet...' );\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn result;\n\t}\n\n\tremoveNoResultCover() {\n\t\tif ( this.no_result_box && this.no_result_box.length > 0 ) {\n\t\t\tthis.no_result_box.remove();\n\t\t}\n\t\tthis.no_result_box = null;\n\t}\n\n\tgetAllColumns( callBack ) {\n\t\tvar $this = this;\n\n\t\tif ( this.api ) { // #2571 - Cannot read property 'getOptions' of null\n\t\t\tthis.api.getOptions( 'columns', {\n\t\t\t\tonResult: function( columns_result ) {\n\t\t\t\t\tvar columns_result_data = columns_result.getResult();\n\t\t\t\t\t$this.all_columns = _global_Global__WEBPACK_IMPORTED_MODULE_1__/* .Global.buildColumnArray */ .x.buildColumnArray( columns_result_data );\n\t\t\t\t\tif ( callBack ) {\n\t\t\t\t\t\tcallBack();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetDefaultDisplayColumns( callBack ) {\n\t\tvar $this = this;\n\t\tthis.api.getOptions( 'default_display_columns', {\n\t\t\tonResult: function( columns_result ) {\n\t\t\t\tvar columns_result_data = columns_result.getResult();\n\t\t\t\t$this.default_display_columns = columns_result_data;\n\t\t\t\tif ( callBack ) {\n\t\t\t\t\tcallBack();\n\t\t\t\t}\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tsetTitle() {\n\t\t$( this.el ).find( '.title' ).text( this.data.name );\n\t}\n\n\tgetAPIByViewName( view_name ) {\n\t\tvar api = null;\n\t\tswitch ( view_name.toLowerCase() ) { //Lower case the view_name to avoid case sensitivity mismatches.\n\t\t\tcase 'message_summary':\n\t\t\t\tapi = TTAPI.APIMessageControl;\n\t\t\t\tbreak;\n\t\t\tcase 'schedule_summary':\n\t\t\tcase 'schedule_summary_child':\n\t\t\tcase 'schedule':\n\t\t\t\tapi = TTAPI.APISchedule;\n\t\t\t\tbreak;\n\t\t\tcase 'exception':\n\t\t\tcase 'exception_summary':\n\t\t\tcase 'exception_summary_child':\n\t\t\t\tapi = TTAPI.APIException;\n\t\t\t\tbreak;\n\t\t\tcase 'invoice':\n\t\t\t\tapi = TTAPI.APIInvoice;\n\t\t\t\tbreak;\n\t\t\tcase 'user':\n\t\t\t\tapi = TTAPI.APIUser;\n\t\t\t\tbreak;\n\t\t\tcase 'request_summary':\n\t\t\tcase 'request':\n\t\t\tcase 'request-authorization':\n\t\t\tcase 'request_authorize_summary':\n\t\t\t\tapi = TTAPI.APIRequest;\n\t\t\t\tbreak;\n\t\t\tcase 'accrual_balance_summary':\n\t\t\t\tapi = TTAPI.APIAccrualBalance;\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_verification_summary':\n\t\t\tcase 'timesheet_verification_summary_child':\n\t\t\t\tapi = TTAPI.APITimesheetSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet_summary':\n\t\t\t\tapi = TTAPI.APITimeSheet;\n\t\t\t\tbreak;\n\t\t\tcase 'user_active_shift_summary':\n\t\t\t\tapi = TTAPI.APIActiveShiftReport;\n\t\t\t\tbreak;\n\t\t\tcase 'payperiodtimesheetverify':\n\t\t\t\tapi = TTAPI.APIPayPeriodTimeSheetVerify;\n\t\t\t\tbreak;\n\t\t\tcase 'userexpense':\n\t\t\tcase 'userexpense-authorization':\n\t\t\t\tapi = TTAPI.APIUserExpense;\n\t\t\t\tbreak;\n\t\t\tcase 'timesheetsummaryreport':\n\t\t\t\tapi = TTAPI.APITimesheetSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'timesheetdetailreport':\n\t\t\t\tapi = TTAPI.APITimesheetDetailReport;\n\t\t\t\tbreak;\n\t\t\tcase 'accrualbalance':\n\t\t\t\tapi = TTAPI.APIAccrualBalance;\n\t\t\t\tbreak;\n\t\t\tcase 'accrual':\n\t\t\t\tapi = TTAPI.APIAccrual;\n\t\t\t\tbreak;\n\t\t\tcase 'recurringschedulecontrol':\n\t\t\t\tapi = TTAPI.APIRecurringScheduleControl;\n\t\t\t\tbreak;\n\t\t\tcase 'recurringscheduletemplatecontrol':\n\t\t\t\tapi = TTAPI.APIRecurringScheduleTemplateControl;\n\t\t\t\tbreak;\n\t\t\tcase 'job':\n\t\t\t\tapi = TTAPI.APIJob;\n\t\t\t\tbreak;\n\t\t\tcase 'jobitem':\n\t\t\t\tapi = TTAPI.APIJobItem;\n\t\t\t\tbreak;\n\t\t\tcase 'usercontact':\n\t\t\t\tapi = TTAPI.APIUserContact;\n\t\t\t\tbreak;\n\t\t\tcase 'userwage':\n\t\t\t\tapi = TTAPI.APIUserWage;\n\t\t\t\tbreak;\n\t\t\tcase 'paystub':\n\t\t\t\tapi = TTAPI.APIPayStub;\n\t\t\t\tbreak;\n\t\t\tcase 'payperiod':\n\t\t\t\tapi = TTAPI.APIPayPeriod;\n\t\t\t\tbreak;\n\t\t\tcase 'paystubamendment':\n\t\t\t\tapi = TTAPI.APIPayStubAmendment;\n\t\t\t\tbreak;\n\t\t\tcase 'client':\n\t\t\t\tapi = TTAPI.APIClient;\n\t\t\t\tbreak;\n\t\t\tcase 'clientcontact':\n\t\t\t\tapi = TTAPI.APIClientContact;\n\t\t\t\tbreak;\n\t\t\tcase 'transaction':\n\t\t\t\tapi = TTAPI.APITransaction;\n\t\t\t\tbreak;\n\t\t\tcase 'userreviewcontrol':\n\t\t\t\tapi = TTAPI.APIUserReviewControl;\n\t\t\t\tbreak;\n\t\t\tcase 'jobvacancy':\n\t\t\t\tapi = TTAPI.APIJobVacancy;\n\t\t\t\tbreak;\n\t\t\tcase 'jobapplicant':\n\t\t\t\tapi = TTAPI.APIJobApplicant;\n\t\t\t\tbreak;\n\t\t\tcase 'jobapplication':\n\t\t\t\tapi = TTAPI.APIJobApplication;\n\t\t\t\tbreak;\n\t\t\tcase 'accrualbalancesummaryreport':\n\t\t\t\tapi = TTAPI.APIAccrualBalanceSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'usersummaryreport':\n\t\t\t\tapi = TTAPI.APIUserSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'activeshiftreport':\n\t\t\t\tapi = TTAPI.APIActiveShiftReport;\n\t\t\t\tbreak;\n\t\t\tcase 'audittrailreport':\n\t\t\t\tapi = TTAPI.APIAuditTrailReport;\n\t\t\t\tbreak;\n\t\t\tcase 'schedulesummaryreport':\n\t\t\t\tapi = TTAPI.APIScheduleSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'punchsummaryreport':\n\t\t\t\tapi = TTAPI.APIPunchSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'exceptionreport':\n\t\t\t\tapi = TTAPI.APIExceptionReport;\n\t\t\t\tbreak;\n\t\t\tcase 'paystubsummaryreport':\n\t\t\t\tapi = TTAPI.APIPayStubSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'userexpensereport':\n\t\t\t\tapi = TTAPI.APIUserExpenseReport;\n\t\t\t\tbreak;\n\t\t\tcase 'jobsummaryreport':\n\t\t\t\tapi = TTAPI.APIJobSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'jobdetailreport':\n\t\t\t\tapi = TTAPI.APIJobDetailReport;\n\t\t\t\tbreak;\n\t\t\tcase 'jobinformationreport':\n\t\t\t\tapi = TTAPI.APIJobInformationReport;\n\t\t\t\tbreak;\n\t\t\tcase 'jobiteminformationreport':\n\t\t\t\tapi = TTAPI.APIJobItemInformationReport;\n\t\t\t\tbreak;\n\t\t\tcase 'invoicetransactionsummaryreport':\n\t\t\t\tapi = TTAPI.APIInvoiceTransactionSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'userqualificationreport':\n\t\t\t\tapi = TTAPI.APIUserQualificationReport;\n\t\t\t\tbreak;\n\t\t\tcase 'kpireport':\n\t\t\t\tapi = TTAPI.APIKPIReport;\n\t\t\t\tbreak;\n\t\t\tcase 'userrecruitmentsummaryreport':\n\t\t\t\tapi = TTAPI.APIUserRecruitmentSummaryReport;\n\t\t\t\tbreak;\n\t\t\tcase 'userrecruitmentdetailreport':\n\t\t\t\tapi = TTAPI.APIUserRecruitmentDetailReport;\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn api;\n\t}\n\n\tsetGridColumnsWidth() {\n\t\tvar col_model = this.grid.getGridParam( 'colModel' );\n\t\tvar grid_data = this.grid.getGridParam( 'data' );\n\t\tthis.grid_total_width = 0;\n\t\t//Possible exception\n\t\t//Error: Uncaught TypeError: Cannot read property 'length' of undefined in /interface/html5/#!m=TimeSheet&date=20141102&user_id=53130 line 4288\n\t\tif ( !col_model ) {\n\t\t\treturn;\n\t\t}\n\t\tfor ( var i = 0; i < col_model.length; i++ ) {\n\t\t\tvar col = col_model[i];\n\t\t\tvar field = col.name;\n\t\t\tvar longest_words = '';\n\t\t\tfor ( var j = 0; j < grid_data.length; j++ ) {\n\t\t\t\tvar row_data = grid_data[j];\n\t\t\t\tif ( !row_data.hasOwnProperty( field ) ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tvar current_words = row_data[field];\n\t\t\t\tif ( !current_words ) {\n\t\t\t\t\tcurrent_words = '';\n\t\t\t\t}\n\t\t\t\tif ( !longest_words ) {\n\t\t\t\t\tlongest_words = current_words.toString();\n\t\t\t\t} else {\n\t\t\t\t\tif ( current_words && current_words.toString().length > longest_words.length ) {\n\t\t\t\t\t\tlongest_words = current_words.toString();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif ( longest_words ) {\n\t\t\t\tvar width_test = $( '' );\n\t\t\t\twidth_test.css( 'font-size', '11' );\n\t\t\t\twidth_test.css( 'font-weight', 'normal' );\n\t\t\t\t$( 'body' ).append( width_test );\n\t\t\t\twidth_test.text( longest_words );\n\t\t\t\tvar width = width_test.width();\n\t\t\t\twidth_test.text( col.label );\n\t\t\t\tvar header_width = width_test.width();\n\t\t\t\tif ( header_width > width ) {\n\t\t\t\t\twidth = header_width + 20;\n\t\t\t\t}\n\t\t\t\tthis.grid_total_width += width + 5;\n\t\t\t\tthis.grid.grid.setColProp( field, { widthOrg: width } );\n\t\t\t\twidth_test.remove();\n\t\t\t}\n\t\t}\n\t\tvar gw = this.grid.getGridParam( 'width' );\n\t\tthis.grid.setGridWidth( gw );\n\t}\n\n}\n\nDashletController.TOTAL_ROW = 4;\nDashletController.REGULAR_ROW = 5;\nDashletController.ABSENCE_ROW = 6;\nDashletController.ACCUMULATED_TIME_ROW = 7;\nDashletController.PREMIUM_ROW = 8;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMTkwLmpzIiwibWFwcGluZ3MiOiI7Ozs7Ozs7O0FBQXdEO0FBQ2Y7O0FBRWxDLGdDQUFnQyxpRUFBYztBQUNyRCwyQkFBMkI7QUFDM0IsRUFBRSxDQUFDO0FBQ0g7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQSxPQUFPLGlHQUF5QixFQUFFLENBQUM7QUFDbkM7QUFDQTs7QUFFQTtBQUNBLE9BQU8sbUdBQTBCO0FBQ2pDLEdBQUcsQ0FBQyxRQUFRLENBQUM7QUFDYjtBQUNBO0FBQ0EsS0FBSztBQUNMO0FBQ0E7QUFDQSxLQUFLO0FBQ0w7QUFDQTtBQUNBLHlFQUF5RTtBQUN6RSw0REFBNEQsQ0FBQyw0Q0FBNEM7O0FBRXpHO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0E7QUFDQSxLQUFLO0FBQ0wsS0FBSztBQUNMO0FBQ0E7O0FBRUE7QUFDQSxRQUFRLGlHQUF5QixFQUFFLENBQUM7QUFDcEM7QUFDQTtBQUNBLElBQUk7O0FBRUo7QUFDQTtBQUNBLElBQUks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