TimeTrex/interface/html5/dist/my_account-timesheet_authorization-TimeSheetAuthorizationViewController.bundle.js

1 line
150 KiB
JavaScript

"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["my_account-timesheet_authorization-TimeSheetAuthorizationViewController"],{8121:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TimeSheetAuthorizationViewController\": () => (/* binding */ TimeSheetAuthorizationViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass TimeSheetAuthorizationViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#time_sheet_authorization_view_container',\n\n\t\t\ttype_array: null,\n\t\t\thierarchy_level_array: null,\n\n\t\t\tmessages: null,\n\n\t\t\tmessage_control_api: null,\n\n\t\t\tauthorization_api: null,\n\n\t\t\trequest_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'TimeSheetAuthorizationEditView.html';\n\t\tthis.permission_id = 'punch';\n\t\tthis.viewId = 'TimeSheetAuthorization';\n\t\tthis.script_name = 'TimeSheetAuthorizationView';\n\t\tthis.table_name_key = 'pay_period_time_sheet_verify';\n\t\tthis.context_menu_name = $.i18n._( 'TimeSheet (Authorizations)' );\n\t\tthis.navigation_label = $.i18n._( 'TimeSheet' );\n\t\tthis.api = TTAPI.APIPayPeriodTimeSheetVerify;\n\t\tthis.request_api = TTAPI.APIRequest;\n\t\tthis.message_control_api = TTAPI.APIMessageControl;\n\t\tthis.authorization_api = TTAPI.APIAuthorization;\n\t\tthis.event_bus = new TTEventBus({ view_id: this.viewId });\n\n\t\tthis.render();\n\t\tthis.buildContextMenu( true );\n\n\t\tthis.initData();\n\n\t\tthis.hierarchy_type_id = 90;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tvar res = this.request_api.getHierarchyLevelOptions( [-1], { async: false } );\n\t\tvar data = res.getResult();\n\t\t$this['hierarchy_level_array'] = Global.buildRecordArray( data );\n\t\tif ( Global.isSet( $this.basic_search_field_ui_dic['hierarchy_level'] ) ) {\n\t\t\t$this.basic_search_field_ui_dic['hierarchy_level'].setSourceData( Global.buildRecordArray( data ) );\n\t\t}\n\t}\n\n\tsearch( set_default_menu, page_action, page_number, callBack ) {\n\t\tthis.refresh_id = null;\n\t\tthis.updateBadgeCount();\n\t\tsuper.search( set_default_menu, page_action, page_number, callBack );\n\t}\n\n\tupdateBadgeCount() {\n\t\tthis.event_bus.emit( 'tt_topbar', 'profile_pending_counts', { //Update \"My Profile\" badge.\n\t\t\tobject_types: [ 'notification', 'timesheet_authorization' ]\n\t\t} );\n\t}\n\n\tprocessResultData( result_data ) {\n\t\tvar len = result_data.length;\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar item = result_data[i];\n\t\t\tif ( item.id == TTUUID.not_exist_id ) {\n\t\t\t\titem.id = item.user_id + '_' + item.pay_period_id;\n\t\t\t}\n\t\t}\n\n\t\treturn result_data;\n\t}\n\n\tparseToRecordId( id, index ) {\n\t\tif ( !id ) {\n\t\t\treturn false;\n\t\t}\n\t\tid = id.toString();\n\t\tif ( id.indexOf( '_' ) > 0 ) {\n\t\t\tif ( index >= 0 ) {\n\t\t\t\treturn id.split( '_' )[index];\n\t\t\t}\n\t\t\treturn TTUUID.not_exist_id;\n\t\t} else {\n\t\t\treturn id;\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\taction: {\n\t\t\t\t\tlabel: $.i18n._( 'Action' ),\n\t\t\t\t\tid: this.script_name + 'action'\n\t\t\t\t},\n\t\t\t\tauthorization: {\n\t\t\t\t\tlabel: $.i18n._( 'Authorization' ),\n\t\t\t\t\tid: this.script_name + 'authorization'\n\t\t\t\t},\n\t\t\t\tobjects: {\n\t\t\t\t\tlabel: $.i18n._( 'Objects' ),\n\t\t\t\t\tid: this.script_name + 'objects'\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: ['default'],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'View' ),\n\t\t\t\t\tid: 'view',\n\t\t\t\t\tgroup: 'action',\n\t\t\t\t\tvue_icon: 'tticon tticon-visibility_black_24dp',\n\t\t\t\t\tshow_on_right_click: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Cancel' ),\n\t\t\t\t\tid: 'cancel',\n\t\t\t\t\tgroup: 'action',\n\t\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Authorize' ),\n\t\t\t\t\tid: 'authorization',\n\t\t\t\t\tvue_icon: 'tticon tticon-thumb_up_black_24dp',\n\t\t\t\t\tmenu_align: 'center'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Pass' ),\n\t\t\t\t\tid: 'pass',\n\t\t\t\t\tvue_icon: 'tticon tticon-redo_black_24dp',\n\t\t\t\t\tmenu_align: 'center'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Decline' ),\n\t\t\t\t\tid: 'decline',\n\t\t\t\t\tvue_icon: 'tticon tticon-thumb_down_black_24dp',\n\t\t\t\t\tmenu_align: 'center'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Jump To' ),\n\t\t\t\t\tid: 'jump_to_header',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\taction_group_header: true,\n\t\t\t\t\tpermission_result: false // to hide it in legacy context menu and avoid errors in legacy parsers.\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'TimeSheet' ),\n\t\t\t\t\tid: 'timesheet',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Schedule' ),\n\t\t\t\t\tid: 'schedule',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\t},\n\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Export' ),\n\t\t\t\t\tid: 'export_excel',\n\t\t\t\t\tgroup: 'other',\n\t\t\t\t\tvue_icon: 'tticon tticon-file_upload_black_24dp',\n\t\t\t\t\tmenu_align: 'right'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Edit Employee' ),\n\t\t\t\t\tid: 'edit_employee',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'jump_to',\n\t\t\t\t\tgroup: 'navigation',\n\t\t\t\t\t},\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tsetDefaultMenuViewIcon( context_btn, grid_selected_length, p_id ) {\n\t\tif ( !this.viewPermissionValidate( p_id ) || this.edit_only_mode ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( grid_selected_length === 1 ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetDefaultMenuEditIcon( context_btn, grid_selected_length ) {\n\t\tif ( !this.editPermissionValidate( 'punch' ) || this.edit_only_mode ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( grid_selected_length === 1 && this.editOwnerOrChildPermissionValidate( 'punch' ) && this.parseToRecordId( this.getGridSelectIdArray()[0] ) !== TTUUID.not_exist_id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuEditIcon( context_btn ) {\n\t\tif ( !this.editPermissionValidate( 'punch' ) || this.edit_only_mode ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\t\tif ( !this.is_viewing || !this.editOwnerOrChildPermissionValidate( 'punch' ) || this.parseToRecordId( this.current_edit_record.id ) === TTUUID.not_exist_id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\t// Error: Unable to get property 'getGridParam' of undefined or null reference\n\t\tvar display_columns = [];\n\t\tif ( this.grid ) {\n\t\t\tdisplay_columns = this.grid.getGridParam( 'colModel' );\n\t\t}\n\n\t\tvar column_filter = {};\n\t\tcolumn_filter.is_owner = true;\n\t\tcolumn_filter.id = true;\n\t\tcolumn_filter.user_id = true;\n\t\tcolumn_filter.is_child = true;\n\t\tcolumn_filter.in_use = true;\n\t\tcolumn_filter.first_name = true;\n\t\tcolumn_filter.last_name = true;\n\t\tcolumn_filter.start_date = true;\n\t\tcolumn_filter.end_date = true;\n\t\tcolumn_filter.pay_period_id = true;\n\n\t\tif ( display_columns ) {\n\t\t\tvar len = display_columns.length;\n\n\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\tvar column_info = display_columns[i];\n\t\t\t\tcolumn_filter[column_info.name] = true;\n\t\t\t}\n\t\t}\n\n\t\treturn column_filter;\n\t}\n\n\tsetDefaultMenuAuthorizationExpenseIcon( context_btn, grid_selected_length ) {\n\t\tif ( !( Global.getProductEdition() >= 25 ) ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'send':\n\t\t\t\tthis.setDefaultMenuSaveIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization':\n\t\t\t\tthis.setDefaultMenuAuthorizationIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'pass':\n\t\t\t\tthis.setDefaultMenuPassIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'decline':\n\t\t\t\tthis.setDefaultMenuDeclineIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_request':\n\t\t\t\tthis.setDefaultMenuAuthorizationRequestIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_timesheet':\n\t\t\t\tthis.setDefaultMenuAuthorizationTimesheetIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet':\n\t\t\t\tthis.setDefaultMenuViewIcon( context_btn, grid_selected_length, 'punch' );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tthis.setDefaultMenuViewIcon( context_btn, grid_selected_length, 'schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'edit_employee':\n\t\t\t\tthis.setDefaultMenuViewIcon( context_btn, grid_selected_length, 'user' );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_expense':\n\t\t\t\tthis.setDefaultMenuAuthorizationExpenseIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetCustomEditMenuIcon( id, context_btn ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'send':\n\t\t\t\tthis.setEditMenuSaveIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization':\n\t\t\t\tthis.setEditMenuAuthorizationIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'pass':\n\t\t\t\tthis.setEditMenuPassIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'decline':\n\t\t\t\tthis.setEditMenuDeclineIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_request':\n\t\t\t\tthis.setEditMenuAuthorizationRequestIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_timesheet':\n\t\t\t\tthis.setEditMenuAuthorizationTimesheetIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet':\n\t\t\t\tthis.setEditMenuNavViewIcon( context_btn, 'punch' );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tthis.setEditMenuNavViewIcon( context_btn, 'schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'edit_employee':\n\t\t\t\tthis.setEditMenuNavEditIcon( context_btn, 'user' );\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_expense':\n\t\t\t\tthis.setEditMenuAuthorizationExpenseIcon( context_btn );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetEditMenuAuthorizationExpenseIcon( context_btn ) {\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'send':\n\t\t\t\tthis.onSaveClick();\n\t\t\t\tbreak;\n\t\t\tcase 'authorization':\n\t\t\t\tthis.onAuthorizationClick();\n\t\t\t\tbreak;\n\t\t\tcase 'pass':\n\t\t\t\tthis.onPassClick();\n\t\t\t\tbreak;\n\t\t\tcase 'decline':\n\t\t\t\tthis.onDeclineClick();\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_request':\n\t\t\t\tthis.onAuthorizationRequestClick();\n\t\t\t\tbreak;\n\t\t\tcase 'authorization_timesheet':\n\t\t\t\tbreak; //Already here, don't do anything.\n\t\t\tcase 'authorization_expense':\n\t\t\t\tthis.onAuthorizationExpenseClick();\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet':\n\t\t\tcase 'schedule':\n\t\t\tcase 'edit_employee':\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onNavigationClick( id );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonAuthorizationExpenseClick() {\n\t\tIndexViewController.goToView( 'ExpenseAuthorization' );\n\t}\n\n\tonNavigationClick( iconName ) {\n\n\t\tvar $this = this;\n\n\t\tvar grid_selected_id_array;\n\n\t\tvar filter = {};\n\n\t\tvar ids = [];\n\n\t\tvar user_ids = [];\n\n\t\tvar base_date;\n\n\t\tif ( $this.edit_view && $this.current_edit_record.id ) {\n\t\t\tids.push( $this.current_edit_record.id );\n\t\t\tuser_ids.push( $this.current_edit_record.user_id );\n\t\t\tbase_date = $this.current_edit_record.start_date;\n\t\t} else {\n\t\t\tgrid_selected_id_array = this.getGridSelectIdArray();\n\t\t\t$.each( grid_selected_id_array, function( index, value ) {\n\t\t\t\tvar grid_selected_row = $this.getRecordFromGridById( value );\n\t\t\t\tids.push( grid_selected_row.id );\n\t\t\t\tuser_ids.push( grid_selected_row.user_id );\n\t\t\t\tbase_date = grid_selected_row.start_date;\n\t\t\t} );\n\t\t}\n\n\t\t//Error: TypeError: Global.strToDateTime(...) is null in interface/html5/framework/jquery.min.js?v=9.0.0-20151014-164655 line 2 > eval line 552\n\t\tbase_date = base_date ? Global.strToDateTime( base_date ).format() : new Date().format();\n\n\t\tswitch ( iconName ) {\n\t\t\tcase 'edit_employee':\n\t\t\t\tif ( user_ids.length > 0 ) {\n\t\t\t\t\tIndexViewController.openEditView( this, 'Employee', user_ids[0] );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'timesheet':\n\t\t\t\tif ( user_ids.length > 0 ) {\n\t\t\t\t\tfilter.user_id = user_ids[0];\n\t\t\t\t\tfilter.base_date = base_date;\n\t\t\t\t\tGlobal.addViewTab( $this.viewId, $.i18n._( 'Authorization - TimeSheet' ), window.location.href );\n\t\t\t\t\tIndexViewController.goToView( 'TimeSheet', filter );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tfilter.filter_data = {};\n\t\t\t\tvar include_users = { value: user_ids };\n\t\t\t\tfilter.filter_data.include_user_ids = include_users;\n\t\t\t\tfilter.select_date = base_date;\n\t\t\t\tGlobal.addViewTab( this.viewId, $.i18n._( 'Authorization - TimeSheet' ), window.location.href );\n\t\t\t\tIndexViewController.goToView( 'Schedule', filter );\n\t\t\t\tbreak;\n\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onExportClick( 'export' + this.api.key_name );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonSaveClick( ignoreWarning ) {\n\t\tif ( !Global.isSet( ignoreWarning ) ) {\n\t\t\tignoreWarning = false;\n\t\t}\n\t\tif ( this.is_edit ) {\n\n\t\t\tvar $this = this;\n\n\t\t\tvar record = {};\n\n\t\t\tthis.is_add = false;\n\n\t\t\trecord = this.uniformVariable( record );\n\n\t\t\tthis.message_control_api['setMessageControl']( record, false, ignoreWarning, {\n\t\t\t\tonResult: function( result ) {\n\n\t\t\t\t\t$this.onSaveResult( result );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tonSaveResult( result ) {\n\t\tvar $this = this;\n\t\tvar current_edit_record_id;\n\n\t\tif ( result.isValid() ) {\n\n\t\t\tcurrent_edit_record_id = $this.current_edit_record.id;\n\n\t\t\t$this.onViewClick( current_edit_record_id, true );\n\n\t\t} else {\n\t\t\t$this.setErrorMenu();\n\t\t\t$this.setErrorTips( result );\n\n\t\t}\n\t}\n\n\tvalidate() {\n\n\t\tvar $this = this;\n\n\t\tvar record = this.current_edit_record;\n\n\t\trecord = this.uniformVariable( record );\n\n\t\tthis.message_control_api['validate' + this.message_control_api.key_name]( record, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.validateResult( result );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tonAuthorizationClick() {\n\t\tvar $this = this;\n\t\tvar data = [];\n\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\tvar grid_selected_length = grid_selected_id_array.length;\n\n\t\tvar getRecordFilterData = ( record_data ) => {\n\t\t\tvar filter = {};\n\t\t\tfilter.authorized = true;\n\t\t\tif ( this.parseToRecordId( record_data.id ) == TTUUID.not_exist_id ) {\n\t\t\t\tfilter.object_id = TTUUID.not_exist_id;\n\t\t\t\tfilter.user_id = record_data.user_id;\n\t\t\t\tfilter.pay_period_id = record_data.pay_period_id;\n\t\t\t} else {\n\t\t\t\tfilter.object_id = record_data.id;\n\t\t\t}\n\t\t\tfilter.object_type_id = 90;\n\n\t\t\treturn filter;\n };\n\n\t\tif ( grid_selected_length > 0 && !this.is_viewing && !this.is_edit ) { //Only do mass authorization if not in list view.\n\t\t\tfor ( var i = 0; i < grid_selected_length; i++ ) {\n\t\t\t\tvar record_data = this.getRecordFromGridById( grid_selected_id_array[i] );\n\t\t\t\tdata.push( getRecordFilterData( record_data ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdata.push( getRecordFilterData( $this.current_edit_record ) );\n\t\t}\n\n\t\t$this.authorization_api['setAuthorization']( data, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tif ( res.isValid() ) {\n\t\t\t\t\t$this.updateBadgeCount();\n\t\t\t\t\tif ( $this.is_edit || $this.is_viewing ) {\n\t\t\t\t\t\t$this.onRightArrowClick( function() {\n\t\t\t\t\t\t\t$this.search( false );\n\t\t\t\t\t\t\t$().TFeedback( {\n\t\t\t\t\t\t\t\tsource: 'Authorize'\n\t\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.search( true );\n\t\t\t\t\t\t$().TFeedback( {\n source: 'Authorize'\n } );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTAlertManager.showErrorAlert( res );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tonPassClick() {\n\t\tvar $this = this;\n\t\tthis.onRightArrowClick( function() {\n\t\t\t$this.search();\n\t\t\t$().TFeedback( {\n\t\t\t\tsource: 'Pass'\n\t\t\t} );\n\t\t} );\n\t}\n\n\tonAuthorizationRequestClick() {\n\t\tIndexViewController.goToView( 'RequestAuthorization' );\n\t}\n\n\tonCancelClick( force_no_confirm, cancel_all, callback ) {\n\t\t//Refresh grid on cancel as its not done during authorize/decline anymore.\n\t\tvar $this = this;\n\t\tsuper.onCancelClick( force_no_confirm, cancel_all, function() {\n\t\t\t//Since we are overriding the callback function to call this.search(), make sure the original callback is still called.\n\t\t\tif ( callback ) {\n\t\t\t\tcallback();\n\t\t\t}\n\n\t\t\t$this.search();\n\t\t} );\n\t}\n\n\tonDeclineClick() {\n\n\t\tvar $this = this;\n\t\tvar data = [];\n\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\tvar grid_selected_length = grid_selected_id_array.length;\n\n\t\tvar getRecordFilterData = ( record_data ) => {\n\t\t\tvar filter = {};\n\t\t\tfilter.authorized = false;\n\t\t\tif ( this.parseToRecordId( record_data.id ) == TTUUID.not_exist_id ) {\n\t\t\t\tfilter.object_id = TTUUID.not_exist_id;\n\t\t\t\tfilter.user_id = record_data.user_id;\n\t\t\t\tfilter.pay_period_id = record_data.pay_period_id;\n\t\t\t} else {\n\t\t\t\tfilter.object_id = record_data.id;\n\t\t\t}\n\t\t\tfilter.object_type_id = 90;\n\n\t\t\treturn filter;\n\t\t};\n\n\t\tif ( grid_selected_length > 0 && !this.is_viewing && !this.is_edit ) { //Only do mass authorization if not in list view.\n\t\t\tfor ( var i = 0; i < grid_selected_length; i++ ) {\n\t\t\t\tvar record_data = this.getRecordFromGridById( grid_selected_id_array[i] );\n\t\t\t\tdata.push( getRecordFilterData( record_data ) );\n\t\t\t}\n\t\t} else {\n\t\t\tdata.push( getRecordFilterData( $this.current_edit_record ) );\n\t\t}\n\n\t\t$this.authorization_api['setAuthorization']( data, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tif ( res.isValid() ) {\n\t\t\t\t\t$this.updateBadgeCount();\n\t\t\t\t\tif ( $this.is_edit || $this.is_viewing ) {\n\t\t\t\t\t\t$this.search( false );\n\t\t\t\t\t\t$this.onRightArrowClick( function() {\n\t\t\t\t\t\t\t$().TFeedback( {\n\t\t\t\t\t\t\t\tsource: 'Decline'\n\t\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.search( true );\n\t\t\t\t\t\t$().TFeedback( {\n\t\t\t\t\t\t\tsource: 'Decline'\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tTAlertManager.showErrorAlert( res );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\tonAuthorizationTimesheetClick() {\n\t\tthis.search( false );\n\t}\n\n\tuniformVariable( records ) {\n\n\t\tvar msg = {};\n\n\t\tif ( this.is_edit && this.current_edit_record != undefined ) {\n\t\t\tmsg.body = this.current_edit_record['body'];\n\t\t\tmsg.from_user_id = this.current_edit_record['user_id'];\n\t\t\tmsg.to_user_id = this.current_edit_record['user_id'];\n\t\t\tmsg.object_id = this.current_edit_record['id'];\n\t\t\tmsg.object_type_id = 90;\n\t\t\tif ( Global.isFalseOrNull( this.current_edit_record['subject'] ) ) {\n\t\t\t\tmsg.subject = this.edit_view_ui_dic['subject'].getValue();\n\t\t\t} else {\n\t\t\t\tmsg.subject = this.current_edit_record['subject'];\n\t\t\t}\n\t\t\treturn msg;\n\t\t}\n\t\trecords.id = this.parseToRecordId( records.id );\n\t\treturn records;\n\t}\n\n\tgetAPIFilters() {\n\t\t// override this function if view requires more filters\n\t\tvar record_id = this.getCurrentSelectedRecord();\n\t\tvar filter = {};\n\n\t\tfilter.filter_data = {};\n\t\tif ( this.parseToRecordId( record_id ) != TTUUID.not_exist_id ) {\n\t\t\tfilter.filter_data.id = [record_id];\n\t\t} else {\n\t\t\tfilter.filter_data.user_id = this.parseToRecordId( record_id, 0 );\n\t\t\tfilter.filter_data.pay_period_id = this.parseToRecordId( record_id, 1 );\n\t\t}\n\n\t\treturn filter;\n\t}\n\n\thandleViewAPICallbackResult( result ) {\n\t\tvar result_data = result.getResult();\n\t\tvar record_id = this.getCurrentSelectedRecord();\n\n\t\tresult_data = this.processResultData( result_data );\n\t\tif ( !result_data ) {\n\t\t\tresult_data = [];\n\t\t}\n\n\t\tresult_data = result_data[0];\n\t\treturn super.handleViewAPICallbackResult( result_data );\n\t}\n\n\tdoViewClickResult( result_data ) {\n\t\tsuper.doViewClickResult( result_data );\n\t\tAuthorizationHistory.init( this );\n\t}\n\n\tonGridDblClickRow() {\n\n\t\tProgressBar.showOverlay();\n\t\tthis.onViewClick();\n\t}\n\n\tsetEditMenuAuthorizationIcon( context_btn ) {\n\t\tif ( this.is_edit ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tsetEditMenuPassIcon( context_btn ) {\n\t\tif ( this.is_edit ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tsetEditMenuDeclineIcon( context_btn ) {\n\t\tif ( this.is_edit ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tsetEditMenuAuthorizationRequestIcon( context_btn ) {\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tsetEditMenuAuthorizationTimesheetIcon( context_btn ) {\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t}\n\t}\n\n\tsetDefaultMenuSaveIcon( context_btn, grid_selected_length ) {\n\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t}\n\n\tsetDefaultMenuAuthorizationIcon( context_btn, grid_selected_length ) {\n\t\tif ( grid_selected_length > 0 ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetDefaultMenuPassIcon( context_btn, grid_selected_length ) {\n\t\tif ( !this.is_viewing ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\n\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t}\n\n\tsetDefaultMenuDeclineIcon( context_btn, grid_selected_length ) {\n\t\tif ( grid_selected_length > 0 ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetDefaultMenuAuthorizationRequestIcon( context_btn, grid_selected_length ) {\n\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t}\n\n\tsetDefaultMenuAuthorizationTimesheetIcon( context_btn, grid_selected_length ) {\n\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Employee' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'user_id',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Pay Period' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'pay_period_id',\n\t\t\t\tlayout_name: 'global_Pay_period',\n\t\t\t\tapi_class: TTAPI.APIPayPeriod,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Hierarchy Level' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tmultiple: false,\n\t\t\t\tset_any: false,\n\t\t\t\tfield: 'hierarchy_level',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tlayout_name: 'global_option_column',\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Created By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'created_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Updated By' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'updated_by',\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\t}\n\n\tonEditClick( editId, noRefreshUI ) {\n\n\t\tvar $this = this;\n\t\tthis.is_viewing = false;\n\t\tthis.is_edit = true;\n\t\tthis.is_add = false;\n\t\tLocalCacheData.current_doing_context_action = 'edit';\n\t\t$this.openEditView();\n\n\t\t$this.initEditView();\n\t}\n\n\tgetSubViewFilter( filter ) {\n\n\t\tif ( filter.length === 0 ) {\n\t\t\tfilter = {};\n\t\t}\n\n\t\tif ( !Global.isSet( filter.hierarchy_level ) ) {\n\t\t\tfilter['hierarchy_level'] = 1;\n\t\t\tthis.filter_data['hierarchy_level'] = {\n\t\t\t\tfield: 'hierarchy_level',\n\t\t\t\tid: '',\n\t\t\t\tvalue: this.basic_search_field_ui_dic['hierarchy_level'].getValue( true )\n\t\t\t};\n\t\t}\n\n\t\treturn filter;\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar tab_model = {\n\t\t\t'tab_timesheet_verification': { 'label': $.i18n._( 'Message' ), 'is_multi_column': true },\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation = null;\n\n\t\t//Tab 0 start\n\n\t\tvar tab_timesheet_verification = this.edit_view_tab.find( '#tab_timesheet_verification' );\n\t\tvar tab_timesheet_verification_column1 = tab_timesheet_verification.find( '.first-column' );\n\t\tvar tab_timesheet_verification_column2 = tab_timesheet_verification.find( '.second-column' );\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_timesheet_verification_column1 );\n\n\t\t// Subject\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'subject', width: 359 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Subject' ), form_item_input, tab_timesheet_verification_column1, '' );\n\n\t\t// Body\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'body', width: 600, height: 400 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Body' ), form_item_input, tab_timesheet_verification_column1, '', null, null, true );\n\t\ttab_timesheet_verification_column2.css( 'display', 'none' );\n\t}\n\n\tneedShowNavigation() {\n\t\tif ( this.is_viewing && this.current_edit_record && Global.isSet( this.current_edit_record.id ) && this.current_edit_record.id ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\tbuildViewUI() {\n\t\tvar pager_data = this.navigation && this.navigation.getPagerData && this.navigation.getPagerData();\n\t\tvar source_data = this.navigation && this.navigation.getSourceData && this.navigation.getSourceData();\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_timesheet_verification': {\n\t\t\t\t'label': $.i18n._( 'TimeSheet Verification' ),\n\t\t\t\t'html_template': this.getTimeSheetAuthorizationTabHtml(),\n\t\t\t},\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIPayPeriodTimeSheetVerify,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_Pay_period',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true,\n\t\t\textendDataProcessWhenSearch: this.processResultData\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\tif ( pager_data && source_data ) {\n\t\t\tthis.navigation.setSourceData( source_data );\n\t\t\tthis.navigation.setPagerData( pager_data );\n\t\t}\n\n\t\t//Tab 0 first column start\n\n\t\tvar tab_timesheet_verification = this.edit_view_tab.find( '#tab_timesheet_verification' );\n\t\tvar tab_timesheet_verification_column1 = tab_timesheet_verification.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_timesheet_verification_column1 );\n\n\t\t// Employee\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'full_name', selected_able: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee' ), form_item_input, tab_timesheet_verification_column1, '' );\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'status', selected_able: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_timesheet_verification_column1, '' );\n\n\t\t// Pay Period\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'pay_period', selected_able: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Pay Period' ), form_item_input, tab_timesheet_verification_column1 );\n\n\t\t// tab_timesheet_verification first column end\n\n\t\tvar separate_box = tab_timesheet_verification.find( '.separate' );\n\n\t\t// Messages\n\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.SEPARATED_BOX );\n\t\tform_item_input.SeparatedBox( { label: $.i18n._( 'Messages' ) } );\n\t\tthis.addEditFieldToColumn( null, form_item_input, separate_box );\n\n\t\tseparate_box.css( 'display', 'none' );\n\n\t\t// Tab 0 second column start\n\n\t\tvar tab_timesheet_verification_column2 = tab_timesheet_verification.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0].push( tab_timesheet_verification_column2 );\n\n\t\t// From\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'from', selected_able: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'From' ), form_item_input, tab_timesheet_verification_column2, '' );\n\n\t\t// Subject\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'subject', selected_able: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Subject' ), form_item_input, tab_timesheet_verification_column2 );\n\n\t\t// Body\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'body', width: 600, height: 400, selected_able: true } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Body' ), form_item_input, tab_timesheet_verification_column2, '', null, true, true );\n\n\t\t// Tab 0 second column end\n\n\t\ttab_timesheet_verification_column2.css( 'display', 'none' );\n\t}\n\n\tinitEditViewUI( view_id, edit_view_file_name ) {\n\t\tGlobal.setUINotready();\n\t\tTTPromise.add( 'init', 'init' );\n\t\tTTPromise.wait();\n\t\tvar $this = this;\n\n\t\tif ( this.edit_view ) {\n\t\t\tthis.edit_view.remove();\n\t\t}\n\n\t\tthis.edit_view = $( Global.loadViewSource( view_id, edit_view_file_name, null, true ) );\n\n\t\tthis.edit_view_tab = $( this.edit_view.find( '.edit-view-tab-bar' ) );\n\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\n\t\t// Moved into generic BaseView.initEditViewTabs\n\t\t// this.setTabOVisibility( false );\n\t\t// this.edit_view_tab = this.edit_view_tab.tabs( {\n\t\t// \tactivate: function( e, ui ) {\n\t\t// \t\t$this.onTabShow( e, ui );\n\t\t// \t}\n\t\t// } );\n\t\t//\n\t\t// this.edit_view_tab.bind( 'tabsselect', function( e, ui ) {\n\t\t// \t$this.onTabIndexChange( e, ui );\n\t\t// } );\n\n\t\tGlobal.contentContainer().append( this.edit_view );\n\t\tthis.initRightClickMenu( RightClickMenuType.EDITVIEW );\n\n\t\tif ( this.is_viewing ) {\n\t\t\tLocalCacheData.current_doing_context_action = 'view';\n\t\t\tthis.buildViewUI();\n\t\t} else if ( this.is_edit ) {\n\t\t\tLocalCacheData.current_doing_context_action = 'edit';\n\t\t\tthis.buildEditViewUI();\n\t\t}\n\n\t\t$this.setEditViewTabHeight();\n\t}\n\n\tinitEditViewTabs() {\n\t\tvar $this = this;\n\t\tvar tab_options = {\n\t\t\tactivate: function( e, ui ) {\n\t\t\t\t$this.onTabShow( e, ui );\n\t\t\t}\n\t\t};\n\n\t\tsuper.initEditViewTabs( tab_options );\n\t}\n\n\tsetCurrentEditRecordData() {\n\n\t\t//Set current edit record data to all widgets\n\t\tfor ( var key in this.current_edit_record ) {\n\t\t\tif ( !this.current_edit_record.hasOwnProperty( key ) ) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\tif ( Global.isSet( widget ) ) {\n\t\t\t\tswitch ( key ) {\n\t\t\t\t\tcase 'full_name':\n\t\t\t\t\t\tif ( this.is_viewing ) {\n\t\t\t\t\t\t\twidget.setValue( this.current_edit_record['first_name'] + ' ' + this.current_edit_record['last_name'] );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'pay_period':\n\t\t\t\t\t\twidget.setValue( this.current_edit_record['start_date'] + ' ' + this.current_edit_record['end_date'] );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'subject':\n\t\t\t\t\t\tif ( this.is_edit ) {\n\t\t\t\t\t\t\tif ( Global.isSet( this.messages ) ) {\n\t\t\t\t\t\t\t\twidget.setValue( 'Re: ' + this.messages[0].subject );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if ( this.is_viewing ) {\n\t\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\t}\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\tthis.collectUIDataToCurrentEditRecord();\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tsetEditViewDataDone() {\n\t\tvar $this = this;\n\t\tsuper.setEditViewDataDone();\n\n\t\tif ( this.is_viewing ) {\n\t\t\tthis.initTimeSheetSummary();\n\t\t\tthis.initExceptionSummary();\n\t\t\t//this.initEmbeddedMessageData();\n\t\t} else {\n\t\t\tif ( Global.isSet( $this.messages ) ) {\n\t\t\t\t$this.messages = null;\n\t\t\t}\n\t\t}\n\t}\n\n\tbuildExceptionDisplayColumns( apiDisplayColumnsArray ) {\n\t\tvar len = this.all_exception_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_exception_columns[i].value ) {\n\t\t\t\t\tdisplay_columns.push( this.all_exception_columns[i] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn display_columns;\n\t}\n\n\tinitExceptionSummary() {\n\n\t\tvar $this = this;\n\t\tif ( !this.api_exception ) {\n\t\t\tthis.api_exception = TTAPI.APIException;\n\t\t}\n\n\t\t$this.buildExceptionGrid();\n\t\t$this.setExceptionGridSize();\n\t\tthis.api_exception.getOptions( 'columns', {\n\t\t\tonResult: function( columns_result ) {\n\t\t\t\tvar columns_result_data = columns_result.getResult();\n\t\t\t\tif ( Global.isSet( $this.current_edit_record ) == false ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tvar args = {\n\t\t\t\t\tfilter_data: {\n\t\t\t\t\t\tuser_id: $this.current_edit_record.user_id,\n\t\t\t\t\t\tpay_period_id: $this.current_edit_record.pay_period_id,\n\t\t\t\t\t\ttype_id: [30, 40, 50, 55, 60]\n\t\t\t\t\t}\n\t\t\t\t};\n\n\t\t\t\t$this.api_exception.getException( args, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.all_exception_columns = Global.buildColumnArray( columns_result_data );\n\t\t\t\t\t\tvar grid;\n\t\t\t\t\t\tif ( !Global.isSet( $this.exception_grid ) ) {\n\t\t\t\t\t\t\tgrid = $( '#exception_grid' );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar display_columns = [\n\t\t\t\t\t\t\t'date_stamp',\n\t\t\t\t\t\t\t'severity',\n\t\t\t\t\t\t\t'exception_policy_type',\n\t\t\t\t\t\t\t'exception_policy_type_id',\n\t\t\t\t\t\t\t'exception_color',\n\t\t\t\t\t\t\t'exception_background_color'\n\t\t\t\t\t\t];\n\t\t\t\t\t\tdisplay_columns = $this.buildExceptionDisplayColumns( display_columns );\n\t\t\t\t\t\t//Set Data Grid on List view\n\t\t\t\t\t\tvar column_info_array = [];\n\t\t\t\t\t\tvar len = display_columns.length;\n\t\t\t\t\t\tvar start_from = 0;\n\t\t\t\t\t\tfor ( var i = start_from; i < len; i++ ) {\n\t\t\t\t\t\t\tvar view_column_data = display_columns[i];\n\t\t\t\t\t\t\tvar column_info = {\n\t\t\t\t\t\t\t\tname: view_column_data.value,\n\t\t\t\t\t\t\t\tindex: view_column_data.value,\n\t\t\t\t\t\t\t\tlabel: view_column_data.label,\n\t\t\t\t\t\t\t\twidth: 100,\n\t\t\t\t\t\t\t\tsortable: false,\n\t\t\t\t\t\t\t\ttitle: false\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tcolumn_info_array.push( column_info );\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$this.buildExceptionGrid( column_info_array );\n\n\t\t\t\t\t\tvar result_data = result.getResult();\n\t\t\t\t\t\tif ( !Global.isArray( result_data ) && TTUUID.isUUID( $this.refresh_id ) == false ) {\n\t\t\t\t\t\t\t$this.showExceptionGridNoResultCover();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this.removeExceptionGridNoResultCover();\n\t\t\t\t\t\t\t$this.exception_grid.setData( Global.formatGridData( result.getResult() ) );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$this.setExceptionGridSize();\n\n\t\t\t\t\t\t$( '.exception-title' ).text( $.i18n._( 'Exceptions' ) );\n\t\t\t\t\t\t$( '.exception-title' ).css( 'width', ( $this.exception_grid.grid.width() - 1 ) + 'px !important' );\n\t\t\t\t\t\t$this.setGridCellBackGround();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildExceptionGrid( column_info_array ) {\n\t\tvar $this = this;\n\n\t\tif ( typeof column_info_array == 'undefined' ) {\n\t\t\tcolumn_info_array = [];\n\t\t}\n\n\t\tif ( this.exception_grid ) {\n\t\t\tthis.exception_grid.grid.jqGrid( 'GridUnload' );\n\t\t\tthis.exception_grid = null;\n\t\t}\n\t\tthis.exception_grid = new TTGrid( 'exception_grid', {\n\t\t\tonResizeGrid: false,\n\t\t\tmultiselect: false,\n\t\t\twinMultiSelect: false,\n\t\t\tgridComplete: function() {\n\t\t\t\tif ( $( this ).jqGrid( 'getGridParam', 'data' ).length > 0 ) {\n\t\t\t\t\t$this.exception_grid.setGridColumnsWidth();\n\t\t\t\t}\n\t\t\t},\n\t\t\tondblClickRow: function( row_id ) {\n\t\t\t\t$this.onExceptionGridDblClickRow( row_id );\n\t\t\t},\n\t\t\tsortable: false,\n\t\t\theight: 160\n\t\t}, column_info_array );\n\t}\n\n\tshowExceptionGridNoResultCover() {\n\t\tthis.removeExceptionGridNoResultCover();\n\t\tthis.exception_grid_no_result_box = Global.loadWidgetByName( WidgetNamesDic.NO_RESULT_BOX );\n\t\tthis.exception_grid_no_result_box.NoResultBox( { related_view_controller: this, is_new: false } );\n\t\tvar grid_div = $( '.exception-grid-div' );\n\t\tgrid_div.css( 'position', 'relative' );\n\t\tthis.exception_grid_no_result_box.attr( 'id', '#exception_grid_no_result_box' );\n\t\tthis.exception_grid_no_result_box.css( 'width', parseInt( grid_div.width() ) + 'px' );\n\t\tthis.exception_grid_no_result_box.css( 'height', parseInt( grid_div.height() ) + 'px' );\n\n\t\tgrid_div.append( this.exception_grid_no_result_box );\n\t}\n\n\tremoveExceptionGridNoResultCover() {\n\t\tif ( this.exception_grid_no_result_box && this.exception_grid_no_result_box.length > 0 ) {\n\t\t\tthis.exception_grid_no_result_box.remove();\n\t\t}\n\t\tthis.exception_grid_no_result_box = null;\n\t}\n\n\tsetEditViewTabSize() {\n\t\tsuper.setEditViewTabSize();\n\t\tthis.setExceptionGridSize();\n\t\tthis.setTimeSheetSummaryGridSize();\n\t}\n\n\tsetGridCellBackGround() {\n\t\tvar data;\n\t\tvar len;\n\t\tvar i;\n\t\tvar item;\n\t\tif ( !this.exception_grid || !this.edit_view ) {\n\t\t\treturn;\n\t\t}\n\t\tdata = this.exception_grid.getGridParam( 'data' );\n\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\tif ( !data ) {\n\t\t\treturn;\n\t\t}\n\t\tlen = data.length;\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\titem = data[i];\n\t\t\tif ( item.exception_background_color ) {\n\t\t\t\tvar severity = this.edit_view.find( 'tr[id=\\'' + item.id + '\\']' ).find( 'td[aria-describedby=\"exception_grid_severity\"]' );\n\t\t\t\tseverity.css( 'background-color', item.exception_background_color );\n\t\t\t\tseverity.css( 'font-weight', 'bold' );\n\t\t\t}\n\t\t\tif ( item.exception_color ) {\n\t\t\t\tvar code = this.edit_view.find( 'tr[id=\\'' + item.id + '\\']' ).find( 'td[aria-describedby=\"exception_grid_exception_policy_type_id\"]' );\n\t\t\t\tcode.css( 'color', item.exception_color );\n\t\t\t\tcode.css( 'font-weight', 'bold' );\n\t\t\t}\n\t\t}\n\t}\n\n\tinitTimeSheetSummary() {\n\t\tvar $this = this;\n\n\t\tif ( Global.isSet( this.current_edit_record ) == false ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.accumulated_total_grid_source_map = {};\n\t\tif ( !this.api_timesheet ) {\n\t\t\tthis.api_timesheet = TTAPI.APITimeSheet;\n\t\t}\n\n\t\t$this.buildAccumulatedTotalGrid();\n\t\tthis.api_timesheet.getTimeSheetData( this.current_edit_record.user_id, this.current_edit_record.start_date, {\n\t\t\tonResult: function( result ) {\n\n\t\t\t\tif ( Global.isSet( $this.current_edit_record ) == false ) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t$this.full_timesheet_data = result.getResult();\n\t\t\t\t$this.pay_period_data = $this.full_timesheet_data.pay_period_data;\n\t\t\t\t$this.timesheet_verify_data = $this.full_timesheet_data.timesheet_verify_data;\n\t\t\t\t$this.start_date = Global.strToDate( $this.full_timesheet_data.timesheet_dates.start_display_date );\n\t\t\t\t$this.end_date = Global.strToDate( $this.full_timesheet_data.timesheet_dates.end_display_date );\n\t\t\t\tvar columns = [];\n\t\t\t\tvar punch_in_out_column = {\n\t\t\t\t\tname: 'punch_info',\n\t\t\t\t\tindex: 'punch_info',\n\t\t\t\t\tlabel: ' ',\n\t\t\t\t\twidth: 200,\n\t\t\t\t\tfixed: true,\n\t\t\t\t\tsortable: false,\n\t\t\t\t\ttitle: false,\n\t\t\t\t\tformatter: $this.onCellFormat\n\t\t\t\t};\n\t\t\t\tcolumns.push( punch_in_out_column );\n\t\t\t\tvar start_date_str = $this.current_edit_record.start_date;\n\t\t\t\tvar end_date_str = $this.current_edit_record.end_date;\n\t\t\t\t$this.getAccumulatedTotalGridPayperiodHeader();\n\t\t\t\tvar column_1 = {\n\t\t\t\t\tname: 'week',\n\t\t\t\t\tindex: 'week',\n\t\t\t\t\tlabel: $.i18n._( 'Week' ) + '<br>' + start_date_str + ' to ' + end_date_str,\n\t\t\t\t\twidth: 100,\n\t\t\t\t\tsortable: false,\n\t\t\t\t\ttitle: false,\n\t\t\t\t\tformatter: $this.onCellFormat\n\t\t\t\t};\n\t\t\t\tvar column_2 = {\n\t\t\t\t\tname: 'pay_period',\n\t\t\t\t\tindex: 'pay_period',\n\t\t\t\t\tlabel: $.i18n._( 'Pay Period' ) + '<br>' + $this.pay_period_header,\n\t\t\t\t\twidth: 100,\n\t\t\t\t\tsortable: false,\n\t\t\t\t\ttitle: false,\n\t\t\t\t\tformatter: $this.onCellFormat\n\t\t\t\t};\n\t\t\t\tcolumns.push( column_2 );\n\t\t\t\t$this.buildAccumulatedTotalGrid( columns );\n\t\t\t\t$this.buildAccumulatedTotalData();\n\t\t\t\t$this.setTimeSheetSummaryGridSize();\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\t//This function is copied from TimeSheetViewController.js\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\t\t\t\t\tif ( key === 'total' || key === 'worked_time' ) {\n\t\t\t\t\t\trow.type = TimeSheetAuthorizationViewController.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 = TimeSheetAuthorizationViewController.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 = TimeSheetAuthorizationViewController.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\t\t\t\t} else if ( parent_key === 'premium_time' ) {\n\t\t\t\t\trow.type = TimeSheetAuthorizationViewController.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.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\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.getTimeUnit( array[key].total_time );\n\t\t\t\t\trow[date_string + '_data'] = array[key];\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} else {\n\t\t\t\t\tarray[key].key = key;\n\t\t\t\t\trow[date_string] = Global.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\tbuildAccumulatedTotalData() {\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.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.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.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.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.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.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.timesheet_authorization_summary_grid.setData( this.accumulated_total_grid_source );\n\n\t\t$( '.timesheet-authorization-summary-title' ).text( $.i18n._( 'TimeSheet Summary' ) );\n\t}\n\n\tsortAccumulatedTotalData() {\n\t\tvar sort_fields = ['order', 'punch_info'];\n\t\tthis.accumulated_total_grid_source.sort( Global.m_sort_by( sort_fields ) );\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.strToDate( pay_period.start_date ).format();\n\t\t\t\t\tvar end_date = Global.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( columns ) {\n\t\tvar $this = this;\n\t\tvar grid;\n\t\tif ( typeof columns == 'undefined' ) {\n\t\t\tcolumns = [];\n\t\t}\n\t\tif ( this.timesheet_authorization_summary_grid ) {\n\t\t\tthis.timesheet_authorization_summary_grid.grid.jqGrid( 'GridUnload' );\n\t\t\tthis.timesheet_authorization_summary_grid = null;\n\t\t}\n\t\tvar $this = this;\n\t\tthis.timesheet_authorization_summary_grid = new TTGrid( 'timesheet_authorization_summary_grid', {\n\t\t\tmultiselect: false,\n\t\t\twinMultiSelect: false,\n\t\t\tsortable: false,\n\t\t\tonResizeGrid: false,\n\t\t\tgridComplete: function() {\n\t\t\t\t$this.setTimeSheetSummaryGridSize();\n\t\t\t},\n\t\t\tondblClickRow: function() {\n\t\t\t\t$this.onTimeSheetGridDblClickRow();\n\t\t\t}\n\t\t}, columns );\n\t\tthis.setTimeSheetSummaryGridSize();\n\t}\n\n\tonTimeSheetGridDblClickRow() {\n\t\tvar filter = { filter_data: {} };\n\t\tfilter.user_id = this.current_edit_record.user_id;\n\t\tfilter.base_date = Global.strToDateTime( this.current_edit_record.start_date ).format();\n\t\tGlobal.addViewTab( this.viewId, $.i18n._( 'TimeSheet (Authorizations)' ), window.location.href );\n\t\tIndexViewController.goToView( 'TimeSheet', filter );\n\t}\n\n\tonExceptionGridDblClickRow( row_id ) {\n\t\tvar date_stamp = this.exception_grid.grid.jqGrid( 'getCell', row_id, 'date_stamp' );\n\n\t\tif ( !date_stamp ) {\n\t\t\tdate_stamp = Global.strToDateTime( this.current_edit_record.start_date ).format();\n\t\t}\n\n\t\tvar filter = { filter_data: {} };\n\t\tfilter.user_id = this.current_edit_record.user_id;\n\t\tfilter.base_date = date_stamp;\n\t\tGlobal.addViewTab( this.viewId, $.i18n._( 'TimeSheet (Authorizations)' ), window.location.href );\n\t\tIndexViewController.goToView( 'TimeSheet', filter );\n\t}\n\n\tonCellFormat( cell_value, related_data, row ) {\n\t\tcell_value = Global.decodeCellValue( cell_value );\n\t\tvar col_model = related_data.colModel;\n\t\tvar row_id = related_data.rowid;\n\t\tvar content_div = $( '<div class=\\'punch-content-div\\'></div>' );\n\t\tvar punch_info;\n\t\tif ( related_data.pos === 0 ) {\n\t\t\tif ( row.type === TimeSheetAuthorizationViewController.TOTAL_ROW ) {\n\t\t\t\tpunch_info = $( '<span class=\\'total\\' style=\\'font-size: 11px\\'></span>' );\n\t\t\t\tif ( Global.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 === TimeSheetAuthorizationViewController.REGULAR_ROW ) {\n\t\t\t\tpunch_info = $( '<span class=\\'top-line-span\\' style=\\'font-size: 11px\\'></span>' );\n\t\t\t\tif ( Global.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 === TimeSheetAuthorizationViewController.TOTAL_ROW ) {\n\t\t\tdata = row[col_model.name + '_data'];\n\t\t\ttime_span = $( '<span class=\\'total\\'></span>' );\n\t\t\tif ( Global.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 === TimeSheetAuthorizationViewController.REGULAR_ROW ) {\n\t\t\tcontent_div.addClass( 'top-line' );\n\t\t\tdata = row[col_model.name + '_data'];\n\t\t\ttime_span = $( '<span ></span>' );\n\t\t\tif ( Global.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 === TimeSheetAuthorizationViewController.ACCUMULATED_TIME_ROW ) {\n\t\t\tdata = row[col_model.name + '_data'];\n\t\t\ttime_span = $( '<span></span>' );\n\t\t\tif ( Global.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 = $( '<span class=\\'punch-time\\'></span>' );\n\t\t\tif ( Global.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\tsetExceptionGridSize() {\n\t\tif ( this.exception_grid ) {\n\t\t\tthis.exception_grid.grid.setGridWidth( $( '.exception-grid-div' ).width() + 1 );\n\n\t\t\tvar size = 2;\n\n\t\t\tvar data_array = this.exception_grid.getData();\n\t\t\tif ( Global.isArray( data_array ) ) {\n\t\t\t\tsize += ( 22 * data_array.length );\n\t\t\t}\n\n\t\t\tthis.exception_grid.setGridHeight( size );\n\t\t}\n\t}\n\n\tsetTimeSheetSummaryGridSize() {\n\t\tif ( this.timesheet_authorization_summary_grid ) {\n\t\t\tthis.timesheet_authorization_summary_grid.grid.setGridWidth( $( '.timesheet-authorization-grid-div' ).width() );\n\n\t\t\tvar size = 2;\n\n\t\t\tvar data_array = this.timesheet_authorization_summary_grid.getData();\n\t\t\tif ( Global.isArray( data_array ) ) {\n\t\t\t\tsize += ( 22 * data_array.length );\n\t\t\t}\n\n\t\t\tthis.timesheet_authorization_summary_grid.setGridHeight( size );\n\t\t}\n\t}\n\n\tgetTimeSheetAuthorizationTabHtml() {\n\t\treturn `\n\t\t<div id=\"tab_timesheet_verification\" class=\"edit-view-tab-outside\">\n\t\t\t<div class=\"edit-view-tab\" id=\"tab_timesheet_verification_content_div\">\n\t\t\t\t<div class=\"first-column full-width-column\"></div>\n\t\t\t\t<div class=\"authorization-grid-div inside-grid full-width-column\">\n\t\t\t\t\t<div class=\"grid-top-border\"></div>\n\t\t\t\t\t<div class=\"grid-title separated-box\"></div>\n\t\t\t\t\t<table id=\"grid\"></table>\n\t\t\t\t\t<div class=\"bottom-div\">\n\t\t\t\t\t\t<div class=\"grid-bottom-border\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<br>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"third-column timesheet-authorization-grid-div\">\n\t\t\t\t\t<div class=\"accumulated-total-grid-title timesheet-authorization-summary-title full-width-column\"></div>\n\t\t\t\t\t<table id=\"timesheet_authorization_summary_grid\"></table>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"forth-column exception-grid-div\">\n\t\t\t\t\t<div class=\"accumulated-total-grid-title exception-title full-width-column\"></div>\n\t\t\t\t\t<table id=\"exception_grid\"></table>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"separate full-width-column\"></div>\n\t\t\t\t<div class=\"second-column full-width-column\" style=\"margin-left: 0\"></div>\n\t\t\t</div>\n\t\t</div>`;\n\t}\n\n}\n\nTimeSheetAuthorizationViewController.TOTAL_ROW = 4;\nTimeSheetAuthorizationViewController.REGULAR_ROW = 5;\nTimeSheetAuthorizationViewController.ABSENCE_ROW = 6;\nTimeSheetAuthorizationViewController.ACCUMULATED_TIME_ROW = 7;\nTimeSheetAuthorizationViewController.PREMIUM_ROW = 8;\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODEyMS5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7QUFFQTtBQUNBOztBQUVBOztBQUVBOztBQUVBOztBQUVBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLENBQUM7QUFDNUIsMEJBQTBCLENB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