"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["common-RequestViewCommonController"],{2343:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RequestViewCommonController\": () => (/* binding */ RequestViewCommonController)\n/* harmony export */ });\n/* harmony import */ var _global_Global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9490);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n\n\nclass RequestViewCommonController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tauthorization_history: null,\n\t\t\tselected_absence_policy_record: null,\n\t\t\tenable_edit_view_ui: false\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tsetGridCellBackGround() {\n\t\t//Error: Unable to get property 'getGridParam' of undefined or null reference\n\t\tif ( !this.grid ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar data = this.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\n\t\tvar len = data.length;\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar item = data[i];\n\n\t\t\tif ( item.status_id == 30 ) {\n\t\t\t\t$( 'tr#' + item.id ).addClass( 'bolder-request' );\n\t\t\t}\n\t\t}\n\t}\n\n\tonCancelClick( force, cancel_all, callback ) {\n\t\tTTPromise.add( 'base', 'onCancelClick' );\n\t\tvar $this = this;\n\n\t\t//#2571 - Unable to get property 'id' of undefined or null reference\n\t\tif ( this.current_edit_record && this.current_edit_record.id ) {\n\t\t\tvar $record_id = this.current_edit_record.id;\n\t\t}\n\n\t\tLocalCacheData.current_doing_context_action = 'cancel';\n\t\tif ( this.is_changed && !force ) {\n\t\t\tTAlertManager.showConfirmAlert( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.modify_alert_message */ .x.modify_alert_message, null, function( flag ) {\n\n\t\t\t\tif ( flag === true ) {\n\t\t\t\t\tdoNext();\n\t\t\t\t}\n\n\t\t\t} );\n\t\t} else {\n\t\t\tdoNext();\n\t\t}\n\n\t\tfunction doNext() {\n\t\t\tif ( !$this.edit_view && $this.parent_view_controller && $this.sub_view_mode ) {\n\t\t\t\t$this.parent_view_controller.is_changed = false;\n\t\t\t\t$this.parent_view_controller.buildContextMenu( true );\n\t\t\t\t$this.parent_view_controller.onCancelClick();\n\n\t\t\t} else {\n\t\t\t\tif ( $this.is_edit && $record_id ) {\n\t\t\t\t\tContextMenuManager.unmountContextMenu( $this.determineContextMenuMountAttributes().id );\n\t\t\t\t\t$this.setCurrentEditViewState( 'view' );\n\t\t\t\t\t$this.onViewClick( $record_id, true );\n\t\t\t\t\t$this.setEditMenu();\n\t\t\t\t} else {\n\t\t\t\t\t$this.removeEditView();\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tif ( callback ) {\n\t\t\t\tcallback();\n\t\t\t}\n\n\t\t\t$this.search( false ); //Refresh the grid, as we don't do that during authorize/decline clicks anymore.\n\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.setUIInitComplete */ .x.setUIInitComplete();\n\t\t\tProgressBar.closeOverlay();\n\n\t\t\tTTPromise.resolve( 'base', 'onCancelClick' );\n\n\t\t}\n\n\t}\n\n\toverlappingShiftUIValidate() {\n\t\t//Same permissions as APISchedule->getOverlappingShifts()\n\t\tif ( !PermissionManager.validate( 'schedule', 'enabled' )\n\t\t\t|| !( PermissionManager.validate( 'schedule', 'view' ) || PermissionManager.validate( 'schedule', 'view_own' ) || PermissionManager.validate( 'schedule', 'view_child' ) ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tonCloseIconClick() {\n\t\tthis.onCancelClick();\n\t}\n\n\tbuildDataForAPI( data ) {\n\t\tif ( this.viewId == 'RequestAuthorization' && ( !data.request_schedule_id || data.request_schedule_id <= 0 ) ) {\n\t\t\treturn data;\n\t\t}\n\n\t\tvar user_id = LocalCacheData.loginUser.id;\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( this.current_edit_record.user_id ) ) {\n\t\t\tuser_id = this.current_edit_record.user_id;\n\t\t}\n\t\tvar data_for_api = { 'user_id': user_id };\n\t\tvar request_schedule = {};\n\n\t\tvar request_schedule_keys = '';\n\n\t\tvar afn = this.getAdvancedFieldNames();\n\n\t\tfor ( var key in this.current_edit_record ) {\n\t\t\tif ( key == 'start_date' && this.edit_view_ui_dic[key] ) {\n\t\t\t\tdata_for_api.date_stamp = this.edit_view_ui_dic[key].getValue();\n\t\t\t}\n\n\t\t\tif ( afn.indexOf( key ) > -1 ) {\n\t\t\t\tif ( key == 'request_schedule_id' ) {\n\t\t\t\t\trequest_schedule['id'] = this.current_edit_record.request_schedule_id;\n\t\t\t\t} else if ( key == 'request_schedule_status_id' ) {\n\t\t\t\t\t//this case is for when asking for default data\n\t\t\t\t\trequest_schedule['status_id'] = this.edit_view_ui_dic.request_schedule_status_id.getValue();\n\t\t\t\t} else if ( this.edit_view_ui_dic[key] ) {\n\t\t\t\t\trequest_schedule[key] = this.edit_view_ui_dic[key].getValue();\n\t\t\t\t}\n\t\t\t} else if ( key == 'available_balance' || key == 'job_item_quick_search' || key == 'job_quick_search' ) {\n\t\t\t\t//ignore. these fields do not need to be saved and break the insert sql.\n\t\t\t} else {\n\t\t\t\tdata_for_api[key] = this.current_edit_record[key];\n\t\t\t}\n\t\t}\n\n\t\t//There is a case where a regular employee has access to submit advanced requests, but the supervisor does not.\n\t\t// In that case we still need to allow advanced requests for authorization.\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 && ( PermissionManager.validate( 'request', 'add_advanced' ) || _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isEmpty */ .x.isEmpty( request_schedule ) == false ) && ( this.current_edit_record.type_id == 30 || this.current_edit_record.type_id == 40 ) ) {\n\t\t\tdata_for_api.request_schedule = request_schedule;\n\t\t}\n\t\treturn data_for_api;\n\t}\n\n\tbuildDataFromAPI( data ) {\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( data ) && _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( data.request_schedule ) ) {\n\t\t\tfor ( var key in data.request_schedule ) {\n\t\t\t\tif ( key == 'id' ) {\n\t\t\t\t\tdata['request_schedule_id'] = data.request_schedule.id;\n\t\t\t\t} else if ( key == 'status_id' ) {\n\t\t\t\t\tdata['request_schedule_status_id'] = data.request_schedule.status_id;\n\t\t\t\t} else if ( typeof ( data[key] ) == 'undefined' ) {\n\t\t\t\t\tdata[key] = data.request_schedule[key];\n\t\t\t\t} else {\n\t\t\t\t\t//Debug.Text('Not overwriting: '+key+' request_schedule: '+data.request_schedule[key]+' request: '+data[key], 'RequestViewCommonController.js', 'RequestViewCommonController','buildDataFromAPI' ,10)\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tdelete data.request_schedule;\n\t\t\tthis.pre_request_schedule = false; //is this a request from before request schedule was added? we need to know if this is an \"old version\" request\n\t\t} else {\n\t\t\tthis.pre_request_schedule = true;\n\t\t}\n\n\t\tvar retval = $.extend( this.current_edit_record, data );\n\t\treturn retval;\n\t}\n\n\tshowAdvancedFields( update_schedule_total_time ) {\n\t\tif (\n\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 &&\n\t\t\t( PermissionManager.validate( 'request', 'add_advanced' )\n\t\t\t\t|| ( TTUUID.isUUID( this.current_edit_record.request_schedule_id ) && this.current_edit_record.request_schedule_id != TTUUID.zero_id && this.current_edit_record.request_schedule_id != TTUUID.not_exist_id ) )\n\t\t\t&& ( this.current_edit_record.type_id == 30 || this.current_edit_record.type_id == 40 ) && ( !this.pre_request_schedule || this.is_add )\n\t\t) {\n\t\t\tvar advanced_field_names = this.getAdvancedFieldNames();\n\t\t\tif ( this.edit_view_ui_dic ) {\n\t\t\t\tfor ( var i = 0; i < advanced_field_names.length; i++ ) {\n\t\t\t\t\tif ( advanced_field_names[i] == 'absence_policy_id' && this.edit_view_ui_dic.request_schedule_status_id && this.edit_view_ui_dic.request_schedule_status_id.getValue() != 20 ) {\n\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tif ( this.edit_view_ui_dic[advanced_field_names[i]] ) {\n\t\t\t\t\t\tif ( advanced_field_names[i] == 'branch_id' && !this.show_branch_ui ) {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t} else if ( advanced_field_names[i] == 'department_id' && !this.show_department_ui ) {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t} else if ( advanced_field_names[i] == 'job_id' && !this.show_job_ui ) {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t} else if ( advanced_field_names[i] == 'job_item_id' && !this.show_job_item_ui ) {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t} else if ( advanced_field_names[i] == 'punch_tag_id' && !this.show_punch_tag_ui ) {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t} else if ( advanced_field_names[i] == 'available_balance' && !this.is_viewing ) {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).show();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( this.edit_view_ui_dic.date ) {\n\t\t\t\t\tthis.edit_view_ui_dic.date_stamp.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t}\n\n\t\t\t\tif ( this.edit_view_ui_dic.available_balance ) {\n\t\t\t\t\tif ( this.is_viewing == true && this.viewId == 'Request' ) {\n\t\t\t\t\t\tthis.edit_view_ui_dic.available_balance.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( this.current_edit_record.type_id != 30 && this.current_edit_record.type_id != 40 ) {\n\t\t\t\t\tif ( this.edit_view_ui_dic.total_time ) {\n\t\t\t\t\t\tthis.edit_view_ui_dic.total_time.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\tthis.edit_view_ui_dic.overlap_type_id.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\tthis.edit_view_ui_dic.is_replace_with_open_shift.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif ( update_schedule_total_time != false ) {\n\t\t\t\t\t\tthis.getScheduleTotalTime();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( this.edit_view_ui_dic.date_stamp ) {\n\t\t\t\tthis.edit_view_ui_dic.date_stamp.parents( '.edit-view-form-item-div' ).show();\n\t\t\t}\n\t\t\tthis.hideAdvancedFields();\n\t\t}\n\t}\n\n\thideAdvancedFields() {\n\t\tvar advanced_field_names = this.getAdvancedFieldNames();\n\t\tif ( this.edit_view_ui_dic ) {\n\t\t\tfor ( var i = 0; i < advanced_field_names.length; i++ ) {\n\t\t\t\tif ( this.edit_view_ui_dic[advanced_field_names[i]] ) {\n\t\t\t\t\tthis.edit_view_ui_dic[advanced_field_names[i]].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( this.edit_view_ui_dic.date ) {\n\t\t\t\tthis.edit_view_ui_dic.date.parents( '.edit-view-form-item-div' ).show();\n\t\t\t}\n\t\t}\n\t}\n\n\tgetAdvancedFieldNames() {\n\t\treturn [\n\t\t\t'request_id',\n\t\t\t'request_schedule_status_id',\n\t\t\t'request_schedule_id',\n\t\t\t'start_date',\n\t\t\t'end_date',\n\n\t\t\t'sun',\n\t\t\t'mon',\n\t\t\t'tue',\n\t\t\t'wed',\n\t\t\t'thu',\n\t\t\t'fri',\n\t\t\t'sat',\n\n\t\t\t'start_time',\n\t\t\t'end_time',\n\t\t\t'total_time',\n\n\t\t\t'schedule_policy_id',\n\t\t\t'absence_policy_id',\n\t\t\t'branch_id',\n\t\t\t'department_id',\n\t\t\t'job_id',\n\t\t\t'job_item_id',\n\t\t\t'punch_tag_id',\n\n\t\t\t'schedule_policy',\n\t\t\t'absence_policy',\n\t\t\t'branch',\n\t\t\t'department',\n\t\t\t'job',\n\t\t\t'job_item',\n\t\t\t'available_balance',\n\n\t\t\t'overlap_type_id',\n\t\t\t'is_replace_with_open_shift'\n\t\t];\n\t}\n\n\tgetScheduleTotalTime() {\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15\n\t\t\t&& ( this.current_edit_record.type_id == 30 || this.current_edit_record.type_id == 40 )\n\t\t\t&& ( this.edit_view_ui_dic && this.edit_view_ui_dic['total_time'] )\n\t\t) {\n\n\t\t\tvar start_time = false;\n\t\t\tif ( this.current_edit_record['start_date'] && this.current_edit_record['start_time'] ) {\n\t\t\t\tstart_time = this.current_edit_record['start_date'] + ' ' + this.current_edit_record['start_time'];\n\t\t\t}\n\n\t\t\tvar end_time = false;\n\t\t\tif ( this.current_edit_record['start_date'] && this.current_edit_record['end_time'] ) {\n\t\t\t\tend_time = this.current_edit_record['start_date'] + ' ' + this.current_edit_record['end_time'];\n\t\t\t}\n\n\t\t\tvar schedulePolicyId = ( this.current_edit_record['schedule_policy_id'] ) ? this.current_edit_record['schedule_policy_id'] : null;\n\t\t\tvar user_id = this.current_edit_record.user_id;\n\n\t\t\tif ( typeof user_id == 'undefined' && LocalCacheData.getLoginUser().id ) {\n\t\t\t\tuser_id = LocalCacheData.getLoginUser().id;\n\t\t\t}\n\n\t\t\tif ( start_time && end_time ) {\n\t\t\t\tvar schedule_api = TTAPI.APISchedule;\n\t\t\t\tvar result = schedule_api.getScheduleTotalTime( start_time, end_time, schedulePolicyId, user_id, { async: false } );\n\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\tthis.total_time = result.getResult();\n\t\t\t\t} else {\n\t\t\t\t\tthis.total_time = 0;\n\t\t\t\t}\n\n\t\t\t\tvar days = 1;\n\t\t\t\tif ( this.current_edit_record.start_date != this.current_edit_record.end_date ) {\n\t\t\t\t\tdays = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getDaysInSpan */ .x.getDaysInSpan( this.current_edit_record.start_date, this.current_edit_record.end_date, this.current_edit_record.sun, this.current_edit_record.mon, this.current_edit_record.tue, this.current_edit_record.wed, this.current_edit_record.thu, this.current_edit_record.fri, this.current_edit_record.sat );\n\t\t\t\t}\n\n\t\t\t\tvar overall_total_time = this.total_time * days;\n\t\t\t\t$('#total_info').text( $.i18n._( 'x %s Day(s) = %s', days, _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( overall_total_time ) ) );\n\n\t\t\t\tthis.current_edit_record['total_time'] = this.total_time;\n\t\t\t\tvar total_time = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( this.total_time );\n\t\t\t\tthis.edit_view_ui_dic['total_time'].setValue( total_time );\n\t\t\t\tthis.edit_view_ui_dic.total_time.parents( '.edit-view-form-item-div' ).show();\n\t\t\t} else {\n\t\t\t\tif ( this.edit_view_ui_dic.total_time ) {\n\t\t\t\t\tthis.edit_view_ui_dic.total_time.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tif ( this.edit_view_ui_dic.total_time ) {\n\t\t\t\tthis.edit_view_ui_dic.total_time.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t}\n\t\t}\n\n\t\tthis.onAvailableBalanceChange();\n\t}\n\n\tonWorkingStatusChanged() {\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) {\n\t\t\tif ( this.edit_view_ui_dic.request_schedule_status_id && this.edit_view_ui_dic.absence_policy_id ) {\n\t\t\t\tvar type_id = this.edit_view_ui_dic.type_id ? this.edit_view_ui_dic.type_id.getValue() : this.current_edit_record.type_id;\n\t\t\t\tthis.showAbsencePolicyField( type_id, this.edit_view_ui_dic.request_schedule_status_id.getValue(), this.edit_view_ui_dic.absence_policy_id );\n\t\t\t}\n\t\t\tthis.showCreateOpenShift();\n\t\t}\n\t}\n\n\tshowCreateOpenShift() {\n\t\tif ( PermissionManager.checkTopLevelPermission( 'RequestAuthorization' ) && this.current_edit_record && this.current_edit_record.request_schedule_status_id == 20 ) {\n\t\t\tthis.attachElement( 'is_replace_with_open_shift' );\n\t\t} else {\n\t\t\tthis.detachElement( 'is_replace_with_open_shift' );\n\t\t}\n\t}\n\n\tshowAbsencePolicyField( type_id, request_schedule_status_id, ui_field ) {\n\t\tif ( request_schedule_status_id == 20 && ( type_id == 30 || type_id == 40 ) ) {\n\t\t\tui_field.parents( '.edit-view-form-item-div' ).show();\n\t\t\tif ( ( this.viewId == 'Request' && this.is_viewing ) == false ) {\n\t\t\t\tthis.onAvailableBalanceChange();\n\t\t\t}\n\t\t} else {\n\t\t\tui_field.parents( '.edit-view-form-item-div' ).hide();\n\t\t\tthis.edit_view_ui_dic.available_balance.parents( '.edit-view-form-item-div' ).hide();\n\t\t}\n\t}\n\n\tonDateStampChanged() {\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 && PermissionManager.validate( 'request', 'add_advanced' ) ) {\n\t\t\tthis.edit_view_ui_dic.start_date.setValue( this.current_edit_record.date_stamp );\n\t\t\tthis.current_edit_record.start_date = this.current_edit_record.date_stamp;\n\t\t}\n\t}\n\n\tonStartDateChanged() {\n\t\tthis.edit_view_ui_dic.date_stamp.setValue( this.current_edit_record.start_date );\n\t\tthis.current_edit_record.date_stamp = this.current_edit_record.start_date;\n\t}\n\n\tgetAvailableBalance() {\n\t\tif ( ( this.is_viewing && this.viewId == 'Request' ) || _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( this.current_edit_record ) == false ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( ( this.viewId != 'Request' || this.is_viewing == false ) &&\n\t\t\tthis.current_edit_record.absence_policy_id &&\n\t\t\t( PermissionManager.validate( 'request', 'add_advanced' ) || ( TTUUID.isUUID( this.current_edit_record.request_schedule_id ) && this.current_edit_record.request_schedule_id != TTUUID.zero_id && this.current_edit_record.request_schedule_id != TTUUID.not_exist_id ) ) &&\n\t\t\tLocalCacheData.loginUser.id &&\n\t\t\tthis.current_edit_record.total_time &&\n\t\t\tthis.current_edit_record.total_time != 0 &&\n\t\t\tthis.current_edit_record.start_date ) {\n\n\t\t\tvar days = 1;\n\t\t\tif ( this.current_edit_record.start_date != this.current_edit_record.end_date ) {\n\t\t\t\tdays = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getDaysInSpan */ .x.getDaysInSpan( this.current_edit_record.start_date, this.current_edit_record.end_date, this.current_edit_record.sun, this.current_edit_record.mon, this.current_edit_record.tue, this.current_edit_record.wed, this.current_edit_record.thu, this.current_edit_record.fri, this.current_edit_record.sat );\n\t\t\t}\n\n\t\t\tvar $this = this;\n\t\t\tvar user_id = this.current_edit_record.user_id;\n\t\t\tvar total_time = this.current_edit_record.total_time * days;\n\t\t\tvar date_stamp = this.current_edit_record.date_stamp;\n\t\t\tvar policy_id = this.current_edit_record.absence_policy_id ? this.current_edit_record.absence_policy_id : TTUUID.zero_id;\n\n\t\t\tif ( user_id && date_stamp && total_time ) {\n\t\t\t\tthis.api_absence_policy.getProjectedAbsencePolicyBalance(\n\t\t\t\t\tpolicy_id,\n\t\t\t\t\tuser_id,\n\t\t\t\t\tdate_stamp,\n\t\t\t\t\ttotal_time,\n\t\t\t\t\t{\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tif ( $this.edit_view_ui_dic && $this.edit_view_ui_dic.available_balance ) {\n\t\t\t\t\t\t\t\t$this.getBalanceHandler( result, date_stamp );\n\t\t\t\t\t\t\t\tif ( result && $this.selected_absence_policy_record ) {\n\t\t\t\t\t\t\t\t\t$this.edit_view_ui_dic.available_balance.parents( '.edit-view-form-item-div' ).show();\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t$this.edit_view_ui_dic.available_balance.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t}\n\t\t\t// If unset or set to --None--...\n\t\t} else if ( this.current_edit_record.absence_policy_id == false || this.current_edit_record.absence_policy_id == TTUUID.zero_id ) {\n\t\t\tif ( this.edit_view_ui_dic.available_balance ) {\n\t\t\t\tthis.edit_view_ui_dic.available_balance.parents( '.edit-view-form-item-div' ).hide();\n\t\t\t}\n\t\t}\n\t}\n\n\tgetFilterColumnsFromDisplayColumns( authorization_history ) {\n\t\t// Error: Unable to get property 'getGridParam' of undefined or null reference\n\t\tvar display_columns = [];\n\t\tif ( authorization_history ) {\n\t\t\tif ( this.authorization_history.authorization_history_grid ) {\n\t\t\t\tdisplay_columns = AuthorizationHistory.getAuthorizationHistoryDefaultDisplayColumns();\n\t\t\t}\n\t\t} else {\n\t\t\tif ( this.grid ) {\n\t\t\t\tdisplay_columns = this.grid.getGridParam( 'colModel' );\n\t\t\t}\n\t\t}\n\t\tvar column_filter = {};\n\t\tcolumn_filter.is_owner = true;\n\t\tcolumn_filter.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.user_id = true;\n\t\tcolumn_filter.status_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\tjobUIValidate() {\n\t\t//use punch permission section rather than schedule permission section as that's what they can see when they're creating punches\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_job' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tjobItemUIValidate() {\n\t\t//use punch permission section rather than schedule permission section as that's what they can see when they're creating punches\n\t\tif ( PermissionManager.validate( 'punch', 'edit_job_item' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpunchTagUIValidate() {\n\t\t//use punch permission section rather than schedule permission section as that's what they can see when they're creating punches\n\t\tif ( PermissionManager.validate( 'punch', 'edit_punch_tag' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbranchUIValidate() {\n\t\t//use punch permission section rather than schedule permission section as that's what they can see when they're creating punches\n\t\tif ( PermissionManager.validate( 'punch', 'edit_branch' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tdepartmentUIValidate() {\n\t\t//use punch permission section rather than schedule permission section as that's what they can see when they're creating punches\n\t\tif ( PermissionManager.validate( 'punch', 'edit_department' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tprocessAPICallbackResult( result_data ) {\n\t\tthis.current_edit_record = this.buildDataFromAPI( result_data[0] );\n\t\tthis.current_edit_record.total_time = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( this.current_edit_record.total_time );\n\n\t\treturn result_data;\n\t}\n\n\tdoViewClickResult( result_data ) {\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( this.current_edit_record.start_date ) && this.edit_view_tab ) {\n\t\t\tthis.edit_view_tab.find( '#tab_request' ).find( '.third-column' ).show();\n\t\t}\n\n\t\tthis.initEditView();\n\t\tthis.initViewingView();\n\n\t\t//This line is required to avoid problems with the absence policy box not showing properly on initial load.\n\t\tthis.onWorkingStatusChanged();\n\n\t\tvar $this = this;\n\t\tEmbeddedMessage.init( this.current_edit_record.id, 50, this, this.edit_view, this.edit_view_tab, this.edit_view_ui_dic, function() {\n\t\t\t$this.authorization_history = AuthorizationHistory.init( $this );\n\t\t\t$this.setEditMenu();\n\t\t} );\n\t\treturn this.clearCurrentSelectedRecord();\n\t}\n\n\tonViewClick( edit_record, clear_edit_view ) {\n\t\tif ( clear_edit_view ) {\n\t\t\tthis.clearEditView();\n\t\t}\n\t\tsuper.onViewClick( edit_record );\n\t}\n\n\tsetSubLogViewFilter() {\n\t\tif ( !this.sub_log_view_controller ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tthis.sub_log_view_controller.getSubViewFilter = function( filter ) {\n\t\t\tfilter['table_name_object_id'] = {\n\t\t\t\t'request': [this.parent_edit_record.id],\n\t\t\t\t'request_schedule': [this.parent_edit_record.request_schedule_id]\n\t\t\t};\n\n\t\t\treturn filter;\n\t\t};\n\n\t\treturn true;\n\t}\n\n\t/**\n\t * This function exists because the edit form is not actually an edit mode form, so we need to do some\n\t * stuff differently in view mode than in edit mode.\n\t */\n\tinitViewingView() {\n\t\tthis.showAdvancedFields();\n\t}\n\n\tinitEditViewUI( view_id, edit_view_file_name ) {\n\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.setUINotready */ .x.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_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadViewSource */ .x.loadViewSource( view_id, edit_view_file_name, null, true ) );\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// Note: Check the 'tabsselect' replaced with generic 'click' in baseview does not cause issue.\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\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.contentContainer */ .x.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\tContextMenuManager.unmountContextMenu( this.determineContextMenuMountAttributes().id );\n\t\t\tthis.buildContextMenu( true );\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\tonEditClick( editId, noRefreshUI ) {\n\t\tthis.setCurrentEditViewState( 'edit' );\n\t\tthis.initEditViewUI( this.viewId, this.edit_view_tpl );\n\t\tthis.initEditView();\n\t\t//Clear last sent message body value.\n\t\tthis.edit_view_ui_dic.body.setValue( '' );\n\t\t//ensure send button is available\n\t\tthis.setEditMenu();\n\t}\n\n\tbuildViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_request': {\n\t\t\t\t'label': $.i18n._( 'Request' ),\n\t\t\t\t'html_template': this.getRequestTabHtml()\n\t\t\t},\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIRequest,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_request',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t//Tab 0 first column start\n\t\tvar tab_request = this.edit_view_tab.find( '#tab_request' );\n\t\tvar tab_request_column1 = tab_request.find( '.first-column' );\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_request_column1 );\n\n\t\t// Employee\n\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'full_name' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee' ), form_item_input, tab_request_column1 );\n\n\t\t// Type\n\t\tvar form_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'type', set_empty: false } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_request_column1 );\n\n\t\t// Date\n\t\tvar form_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT );\n\t\tform_item_input.TText( { field: 'date_stamp' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date' ), form_item_input, tab_request_column1 );\n\n\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) {\n\n\t\t\t//Working Status\n\t\t\tvar form_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\t\tform_item_input.TComboBox( { field: 'request_schedule_status_id', set_empty: false } );\n\t\t\tform_item_input.setSourceData( { 10: 'Working', 20: 'Absent' } );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_request_column1 );\n\t\t\tform_item_input.bind( 'change', function( e ) {\n\t\t\t\t$this.onWorkingStatusChanged();\n\t\t\t} );\n\n\t\t\t//Absence Policy\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIAbsencePolicy,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_absences',\n\t\t\t\tset_empty: true,\n\t\t\t\tfield: 'absence_policy_id',\n\t\t\t\tcustomSearchFilter: function( filter ) {\n\t\t\t\t\treturn $this.setAbsencePolicyFilter( filter );\n\t\t\t\t},\n\t\t\t\tsetRealValueCallBack: function( value ) {\n\t\t\t\t\t// #2135 fix for cases where user is removed from absence policies between creating request and approval\n\t\t\t\t\t$this.selected_absence_policy_record = value;\n\t\t\t\t\t$this.onAvailableBalanceChange();\n\t\t\t\t}\n\t\t\t} );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Absence Policy' ), form_item_input, tab_request_column1 );\n\n\t\t\t//Available Balance\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'available_balance' } );\n\t\t\twidgetContainer = $( '
' );\n\t\t\tthis.available_balance_info = $( '' );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\twidgetContainer.append( this.available_balance_info );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Available Balance' ), form_item_input, tab_request_column1, '', widgetContainer, true );\n\n\t\t\t//Start Date\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\t\tform_item_input.TDatePicker( { field: 'start_date' } );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Start Date' ), form_item_input, tab_request_column1, '' );\n\n\t\t\t//End Date\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\t\tform_item_input.TDatePicker( { field: 'end_date' } );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'End Date' ), form_item_input, tab_request_column1, '' );\n\n\t\t\t// Effective Days\n\t\t\tvar form_item_sun_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_sun_checkbox.TCheckbox( { field: 'sun' } );\n\n\t\t\tvar form_item_mon_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_mon_checkbox.TCheckbox( { field: 'mon' } );\n\n\t\t\tvar form_item_tue_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_tue_checkbox.TCheckbox( { field: 'tue' } );\n\n\t\t\tvar form_item_wed_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_wed_checkbox.TCheckbox( { field: 'wed' } );\n\n\t\t\tvar form_item_thu_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_thu_checkbox.TCheckbox( { field: 'thu' } );\n\n\t\t\tvar form_item_fri_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_fri_checkbox.TCheckbox( { field: 'fri' } );\n\n\t\t\tvar form_item_sat_checkbox = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_sat_checkbox.TCheckbox( { field: 'sat' } );\n\n\t\t\twidgetContainer = $( '
' );\n\n\t\t\tvar sun = $( ' ' + $.i18n._( 'Sun' ) + '
' + '
' );\n\t\t\tvar mon = $( ' ' + $.i18n._( 'Mon' ) + '
' + '
' );\n\t\t\tvar tue = $( ' ' + $.i18n._( 'Tue' ) + '
' + '
' );\n\t\t\tvar wed = $( ' ' + $.i18n._( 'Wed' ) + '
' + '
' );\n\t\t\tvar thu = $( ' ' + $.i18n._( 'Thu' ) + '
' + '
' );\n\t\t\tvar fri = $( ' ' + $.i18n._( 'Fri' ) + '
' + '
' );\n\t\t\tvar sat = $( ' ' + $.i18n._( 'Sat' ) + '
' + '
' );\n\n\t\t\tsun.append( form_item_sun_checkbox );\n\t\t\tmon.append( form_item_mon_checkbox );\n\t\t\ttue.append( form_item_tue_checkbox );\n\t\t\twed.append( form_item_wed_checkbox );\n\t\t\tthu.append( form_item_thu_checkbox );\n\t\t\tfri.append( form_item_fri_checkbox );\n\t\t\tsat.append( form_item_sat_checkbox );\n\n\t\t\twidgetContainer.append( sun );\n\t\t\twidgetContainer.append( mon );\n\t\t\twidgetContainer.append( tue );\n\t\t\twidgetContainer.append( wed );\n\t\t\twidgetContainer.append( thu );\n\t\t\twidgetContainer.append( fri );\n\t\t\twidgetContainer.append( sat );\n\n\t\t\twidgetContainer.addClass( 'request_edit_view_effective_days' );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Effective Days' ), [form_item_sun_checkbox, form_item_mon_checkbox, form_item_tue_checkbox, form_item_wed_checkbox, form_item_thu_checkbox, form_item_fri_checkbox, form_item_sat_checkbox], tab_request_column1, '', widgetContainer, false, true );\n\n\t\t\t//Start time\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TIME_PICKER );\n\t\t\tform_item_input.TTimePicker( { field: 'start_time' } );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'In' ), form_item_input, tab_request_column1 );\n\n\t\t\t//End time\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TIME_PICKER );\n\t\t\tform_item_input.TTimePicker( { field: 'end_time' } );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Out' ), form_item_input, tab_request_column1 );\n\n\t\t\t// Total\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'total_time' } );\n\t\t\twidgetContainer = $( '
' );\n\t\t\tlabel = $( '' );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\twidgetContainer.append( label );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Total' ), form_item_input, tab_request_column1, '', widgetContainer );\n\n\t\t\tif ( ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 15 ) && this.overlappingShiftUIValidate() == true ) {\n\t\t\t\t//Override / Split shift\n\t\t\t\tvar form_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\t\t\tform_item_input.TComboBox( { field: 'overlap_type_id', set_empty: false } );\n\t\t\t\tform_item_input.setSourceData( this.overlap_type_array );\n\t\t\t\twidgetContainer = $( '
' );\n\t\t\t\tthis.overlapping_shift_info = $( '' );\n\t\t\t\twidgetContainer.append( form_item_input );\n\t\t\t\twidgetContainer.append( this.overlapping_shift_info );\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Overlapping Shift(s)' ), form_item_input, tab_request_column1, '', widgetContainer, true );\n\n\t\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\t\tform_item_input.TCheckbox( { field: 'is_replace_with_open_shift' } );\n\n\t\t\t\twidgetContainer = $( '
' );\n\t\t\t\tlabel = $( '( ' + $.i18n._( 'For Absences' ) + ' )' );\n\t\t\t\twidgetContainer.append( form_item_input );\n\t\t\t\twidgetContainer.append( label );\n\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Create Open Shift' ), form_item_input, tab_request_column1, '', widgetContainer, true );\n\n\t\t\t}\n\n\t\t\t//Schedule Policy\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APISchedulePolicy,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_schedule',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tfield: 'schedule_policy_id'\n\t\t\t} );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Schedule Policy' ), form_item_input, tab_request_column1 );\n\n\t\t\t//Branch\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIBranch,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_branch',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tfield: 'branch_id'\n\t\t\t} );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Branch' ), form_item_input, tab_request_column1 );\n\t\t\tif ( !this.show_branch_ui ) {\n\t\t\t\tthis.detachElement( 'branch_id' );\n\t\t\t}\n\n\t\t\t//Department\n\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIDepartment,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_department',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_empty: true,\n\t\t\t\tfield: 'department_id'\n\t\t\t} );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Department' ), form_item_input, tab_request_column1 );\n\t\t\tif ( !this.show_department_ui ) {\n\t\t\t\tthis.detachElement( 'department_id' );\n\t\t\t}\n\n\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() >= 20 ) {\n\t\t\t\t//Job\n\t\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\t\tform_item_input.AComboBox( {\n\t\t\t\t\tapi_class: TTAPI.APIJob,\n\t\t\t\t\tallow_multiple_selection: false,\n\t\t\t\t\tlayout_name: 'global_job',\n\t\t\t\t\tshow_search_inputs: true,\n\t\t\t\t\tset_empty: true,\n\t\t\t\t\tsetRealValueCallBack: ( function( val ) {\n\n\t\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\t\tjob_coder.setValue( val.manual_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ),\n\t\t\t\t\tfield: 'job_id',\n\t\t\t\t\tadded_items: [\n\t\t\t\t\t\t{ value: '-1', label: _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.default_item */ .x.default_item },\n\t\t\t\t\t\t{ value: '-2', label: _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.selected_item */ .x.selected_item }\n\t\t\t\t\t]\n\t\t\t\t} );\n\n\t\t\t\twidgetContainer = $( '
' );\n\n\t\t\t\tvar job_coder = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\t\tjob_coder.TTextInput( { field: 'job_quick_search', disable_keyup_event: true } );\n\t\t\t\tjob_coder.addClass( 'job-coder' );\n\n\t\t\t\twidgetContainer.append( job_coder );\n\t\t\t\twidgetContainer.append( form_item_input );\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Job' ), [form_item_input, job_coder], tab_request_column1, '', widgetContainer, true );\n\n\t\t\t\tif ( !this.show_job_ui ) {\n\t\t\t\t\tthis.detachElement( 'job_id' );\n\t\t\t\t}\n\n\t\t\t\t//Job Item\n\t\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\t\tform_item_input.AComboBox( {\n\t\t\t\t\tapi_class: TTAPI.APIJobItem,\n\t\t\t\t\tallow_multiple_selection: false,\n\t\t\t\t\tlayout_name: 'global_job_item',\n\t\t\t\t\tshow_search_inputs: true,\n\t\t\t\t\tset_empty: true,\n\t\t\t\t\tsetRealValueCallBack: ( function( val ) {\n\n\t\t\t\t\t\tif ( val ) {\n\t\t\t\t\t\t\tjob_item_coder.setValue( val.manual_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ),\n\t\t\t\t\tfield: 'job_item_id',\n\t\t\t\t\tadded_items: [\n\t\t\t\t\t\t{ value: '-1', label: _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.default_item */ .x.default_item },\n\t\t\t\t\t\t{ value: '-2', label: _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.selected_item */ .x.selected_item }\n\t\t\t\t\t]\n\t\t\t\t} );\n\n\t\t\t\twidgetContainer = $( '
' );\n\n\t\t\t\tvar job_item_coder = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\t\tjob_item_coder.TTextInput( { field: 'job_item_quick_search', disable_keyup_event: true } );\n\t\t\t\tjob_item_coder.addClass( 'job-coder' );\n\n\t\t\t\twidgetContainer.append( job_item_coder );\n\t\t\t\twidgetContainer.append( form_item_input );\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Task' ), [form_item_input, job_item_coder], tab_request_column1, '', widgetContainer, true );\n\n\t\t\t\tif ( !this.show_job_item_ui ) {\n\t\t\t\t\tthis.detachElement( 'job_item_id' );\n\t\t\t\t}\n\n\t\t\t\t//Punch Tag\n\t\t\t\tform_item_input = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\t\tform_item_input.AComboBox( {\n\t\t\t\t\tapi_class: TTAPI.APIPunchTag,\n\t\t\t\t\tallow_multiple_selection: true,\n\t\t\t\t\tlayout_name: 'global_punch_tag',\n\t\t\t\t\tshow_search_inputs: true,\n\t\t\t\t\tset_empty: true,\n\t\t\t\t\tsetRealValueCallBack: ( ( punch_tags ) => {\n\t\t\t\t\t\tif ( punch_tags ) {\n\t\t\t\t\t\t\tthis.setPunchTagQuickSearchManualIds( punch_tags );\n\t\t\t\t\t\t}\n\t\t\t\t\t} ),\n\t\t\t\t\tfield: 'punch_tag_id'\n\t\t\t\t} );\n\n\t\t\t\twidgetContainer = $( '
' );\n\n\t\t\t\tvar punch_tag_coder = _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.loadWidgetByName */ .x.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\t\tpunch_tag_coder.TTextInput( { field: 'punch_tag_quick_search', disable_keyup_event: true } );\n\t\t\t\tpunch_tag_coder.addClass( 'job-coder' );\n\n\t\t\t\twidgetContainer.append( punch_tag_coder );\n\t\t\t\twidgetContainer.append( form_item_input );\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Punch Tags' ), [form_item_input, punch_tag_coder], tab_request_column1, '', widgetContainer, true );\n\n\t\t\t\tif ( !this.show_punch_tag_ui ) {\n\t\t\t\t\tthis.detachElement( 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tEmbeddedMessage.initUI( this, tab_request );\n\t}\n\n\tsetAbsencePolicyFilter( filter ) {\n\t\tif ( !filter.filter_data ) {\n\t\t\tfilter.filter_data = {};\n\t\t}\n\t\tfilter.filter_data.user_id = this.current_edit_record.user_id;\n\n\t\tif ( filter.filter_columns ) {\n\t\t\tfilter.filter_columns.absence_policy = true;\n\t\t}\n\t\treturn filter;\n\t}\n\n\tneedShowNavigation() {\n\t\tif ( this.is_viewing && this.current_edit_record && _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.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\tonNavigationClick( iconName ) {\n\n\t\tvar $this = this;\n\t\tvar filter;\n\t\tvar temp_filter;\n\t\tvar grid_selected_id_array;\n\t\tvar grid_selected_length;\n\n\t\tvar selectedId;\n\t\t/* jshint ignore:start */\n\t\tswitch ( iconName ) {\n\t\t\tcase 'timesheet':\n\t\t\t\tfilter = { filter_data: {} };\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( this.current_edit_record ) ) {\n\n\t\t\t\t\tfilter.user_id = this.current_edit_record.user_id ? this.current_edit_record.user_id : LocalCacheData.loginUser.id;\n\t\t\t\t\tfilter.base_date = this.current_edit_record.date_stamp;\n\n\t\t\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.addViewTab */ .x.addViewTab( $this.viewId, $.i18n._( 'Authorization - Request' ), window.location.href );\n\t\t\t\t\tIndexViewController.goToView( 'TimeSheet', filter );\n\n\t\t\t\t} else {\n\t\t\t\t\ttemp_filter = {};\n\t\t\t\t\tgrid_selected_id_array = this.getGridSelectIdArray();\n\t\t\t\t\tgrid_selected_length = grid_selected_id_array.length;\n\n\t\t\t\t\tif ( grid_selected_length > 0 ) {\n\t\t\t\t\t\tselectedId = grid_selected_id_array[0];\n\n\t\t\t\t\t\ttemp_filter.filter_data = {};\n\t\t\t\t\t\ttemp_filter.filter_columns = { user_id: true, date_stamp: true };\n\t\t\t\t\t\ttemp_filter.filter_data.id = [selectedId];\n\n\t\t\t\t\t\tthis.api['get' + this.api.key_name]( temp_filter, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tresult_data = result_data[0];\n\n\t\t\t\t\t\t\t\tfilter.user_id = result_data.user_id;\n\t\t\t\t\t\t\t\tfilter.base_date = result_data.date_stamp;\n\t\t\t\t\t\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.addViewTab */ .x.addViewTab( $this.viewId, $.i18n._( 'Authorization - Request' ), window.location.href );\n\t\t\t\t\t\t\t\tIndexViewController.goToView( 'TimeSheet', filter );\n\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\n\t\t\t\tbreak;\n\n\t\t\tcase 'edit_employee':\n\t\t\t\tfilter = { filter_data: {} };\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( this.current_edit_record ) ) {\n\t\t\t\t\tIndexViewController.openEditView( this, 'Employee', this.current_edit_record.user_id ? this.current_edit_record.user_id : LocalCacheData.loginUser.id );\n\t\t\t\t} else {\n\t\t\t\t\ttemp_filter = {};\n\t\t\t\t\tgrid_selected_id_array = this.getGridSelectIdArray();\n\t\t\t\t\tgrid_selected_length = grid_selected_id_array.length;\n\n\t\t\t\t\tif ( grid_selected_length > 0 ) {\n\t\t\t\t\t\tselectedId = grid_selected_id_array[0];\n\n\t\t\t\t\t\ttemp_filter.filter_data = {};\n\t\t\t\t\t\ttemp_filter.filter_columns = { user_id: true };\n\t\t\t\t\t\ttemp_filter.filter_data.id = [selectedId];\n\n\t\t\t\t\t\tthis.api['get' + this.api.key_name]( temp_filter, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tresult_data = result_data[0];\n\n\t\t\t\t\t\t\t\tIndexViewController.openEditView( $this, 'Employee', result_data.user_id );\n\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\tbreak;\n\t\t\tcase 'schedule':\n\n\t\t\t\tfilter = { filter_data: {} };\n\n\t\t\t\tvar include_users = null;\n\n\t\t\t\tif ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.isSet */ .x.isSet( this.current_edit_record ) ) {\n\n\t\t\t\t\tinclude_users = [this.current_edit_record.user_id ? this.current_edit_record.user_id : LocalCacheData.loginUser.id];\n\t\t\t\t\tfilter.filter_data.include_user_ids = { value: include_users };\n\t\t\t\t\tfilter.select_date = this.current_edit_record.date_stamp;\n\n\t\t\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.addViewTab */ .x.addViewTab( $this.viewId, $.i18n._( 'Authorization - Request' ), window.location.href );\n\t\t\t\t\tIndexViewController.goToView( 'Schedule', filter );\n\n\t\t\t\t} else {\n\t\t\t\t\ttemp_filter = {};\n\t\t\t\t\tgrid_selected_id_array = this.getGridSelectIdArray();\n\t\t\t\t\tgrid_selected_length = grid_selected_id_array.length;\n\n\t\t\t\t\tif ( grid_selected_length > 0 ) {\n\t\t\t\t\t\tselectedId = grid_selected_id_array[0];\n\n\t\t\t\t\t\ttemp_filter.filter_data = {};\n\t\t\t\t\t\ttemp_filter.filter_columns = { user_id: true, date_stamp: true };\n\t\t\t\t\t\ttemp_filter.filter_data.id = [selectedId];\n\n\t\t\t\t\t\tthis.api['get' + this.api.key_name]( temp_filter, {\n\t\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tresult_data = result_data[0];\n\n\t\t\t\t\t\t\t\tinclude_users = [result_data.user_id];\n\n\t\t\t\t\t\t\t\tfilter.filter_data.include_user_ids = include_users;\n\t\t\t\t\t\t\t\tfilter.select_date = result_data.date_stamp;\n\n\t\t\t\t\t\t\t\t_global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.addViewTab */ .x.addViewTab( $this.viewId, $.i18n._( 'Authorization - Request' ), window.location.href );\n\t\t\t\t\t\t\t\tIndexViewController.goToView( 'Schedule', filter );\n\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\tbreak;\n\t\t}\n\n\t\t/* jshint ignore:end */\n\t}\n\n\tinitPermission() {\n\t\tif ( PermissionManager.validate( this.permission_id, 'view' ) || PermissionManager.validate( this.permission_id, 'view_child' ) ) {\n\t\t\tthis.show_search_tab = true;\n\t\t} else {\n\t\t\tthis.show_search_tab = false;\n\t\t}\n\n\t\tif ( this.jobUIValidate() ) {\n\t\t\tthis.show_job_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_ui = false;\n\t\t}\n\n\t\tif ( this.jobItemUIValidate() ) {\n\t\t\tthis.show_job_item_ui = true;\n\t\t} else {\n\t\t\tthis.show_job_item_ui = false;\n\t\t}\n\n\t\tif ( this.punchTagUIValidate() ) {\n\t\t\tthis.show_punch_tag_ui = true;\n\t\t} else {\n\t\t\tthis.show_punch_tag_ui = false;\n\t\t}\n\n\t\tif ( this.branchUIValidate() ) {\n\t\t\tthis.show_branch_ui = true;\n\t\t} else {\n\t\t\tthis.show_branch_ui = false;\n\t\t}\n\n\t\tif ( this.departmentUIValidate() ) {\n\t\t\tthis.show_department_ui = true;\n\t\t} else {\n\t\t\tthis.show_department_ui = false;\n\t\t}\n\n\t\t// Error: Uncaught TypeError: (intermediate value).isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled is not a function on line 207\n\t\tvar company_api = TTAPI.APICompany;\n\t\tif ( company_api && _.isFunction( company_api.isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled ) ) {\n\t\t\tvar result = company_api.isBranchAndDepartmentAndJobAndJobItemAndPunchTagEnabled( { async: false } ).getResult();\n\t\t}\n\n\t\tif ( !result ) {\n\t\t\tthis.show_branch_ui = false;\n\t\t\tthis.show_department_ui = false;\n\t\t\tthis.show_job_ui = false;\n\t\t\tthis.show_job_item_ui = false;\n\t\t\tthis.show_punch_tag_ui = false;\n\t\t} else {\n\t\t\tif ( !result.branch ) {\n\t\t\t\tthis.show_branch_ui = false;\n\t\t\t}\n\n\t\t\tif ( !result.department ) {\n\t\t\t\tthis.show_department_ui = false;\n\t\t\t}\n\n\t\t\tif ( !result.job ) {\n\t\t\t\tthis.show_job_ui = false;\n\t\t\t}\n\n\t\t\tif ( !result.job_item ) {\n\t\t\t\tthis.show_job_item_ui = false;\n\t\t\t}\n\n\t\t\tif ( !result.punch_tag ) {\n\t\t\t\tthis.show_punch_tag_ui = false;\n\t\t\t}\n\t\t}\n\n\t}\n\n\tsetEditMenuEditIcon( context_btn ) {\n\t\tif ( !this.editPermissionValidate( 'request' ) ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\t//If edit_child is FALSE and this is a child record, inputs should be read-only.\n\t\tif ( this.editOwnerOrChildPermissionValidate( 'request' ) ) {\n\t\t\tthis.enable_edit_view_ui = true;\n\t\t} else {\n\t\t\tthis.enable_edit_view_ui = false;\n\t\t}\n\n\t\tif ( !this.editOwnerOrChildPermissionValidate( 'request' ) || this.is_add || this.is_edit ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tgetOverlappingShifts() {\n\t\tlet $this = this;\n\n\t\tif ( !this.current_edit_record || !this.current_edit_record.type_id ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//Do not get overlapping shifts if user does not have schedule permissions, is on a lower product edition or request is not a schedule change.\n\t\tif ( this.overlappingShiftUIValidate() == false || ( _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getProductEdition */ .x.getProductEdition() < 15 ) || ( this.current_edit_record.type_id == 30 || this.current_edit_record.type_id == 40 ) == false ) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet data = {};\n\t\tdata.start_date = this.current_edit_record.start_date;\n\t\tdata.end_date = this.current_edit_record.end_date;\n\t\tdata.user_id = this.current_edit_record.user_id;\n\t\tdata.start_time = this.current_edit_record.start_time;\n\t\tdata.end_time = this.current_edit_record.end_time;\n\n\t\tdata.overlap_type_id = this.current_edit_record.overlap_type_id;\n\n\t\tdata.schedule_policy_id = this.current_edit_record.schedule_policy_id;\n\t\tdata.absence_policy_id = this.current_edit_record.absence_policy_id;\n\t\tdata.request_schedule_status_id = this.current_edit_record.request_schedule_status_id;\n\n\t\tdata.requested_days = {};\n\n\t\tdata.requested_days[0] = this.current_edit_record.sun;\n\t\tdata.requested_days[1] = this.current_edit_record.mon;\n\t\tdata.requested_days[2] = this.current_edit_record.tue;\n\t\tdata.requested_days[3] = this.current_edit_record.wed;\n\t\tdata.requested_days[4] = this.current_edit_record.thu;\n\t\tdata.requested_days[5] = this.current_edit_record.fri;\n\t\tdata.requested_days[6] = this.current_edit_record.sat;\n\n\t\tdata.is_replace_with_open_shift = this.current_edit_record.is_replace_with_open_shift;\n\n\t\tthis.schedule_api.getOverlappingShifts( data, {\n\t\t\tonResult: function( result ) {\n\t\t\t\tlet result_data = result.getResult();\n\n\t\t\t\tif ( !result_data || !result_data.split ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.overlapping_shift_data = result_data;\n\n\t\t\t\t$this.buildOverlappingShiftInfo();\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildOverlappingShiftInfo() {\n\t\tlet $this = this;\n\n\t\tif ( !this.current_edit_record ) {\n\t\t\t//Issue #3216 - Error: Uncaught TypeError: Cannot read properties of null (reading 'overlap_type_id')\n\t\t\t//This could happen under race conditions or opening a request and then quickly closing it when experiencing latency.\n\t\t\treturn;\n\t\t}\n\n\t\tlet overlapping_shifts_html = '';\n\t\tlet split_shifts = this.overlapping_shift_data['split'];\n\t\tlet shifts_after = 0;\n\t\tlet shifts_before = 0;\n\t\tlet shifts_after_total_time = 0;\n\t\tlet shifts_before_total_time = 0;\n\n\t\tlet suggested_overlap_type_id = 10; //Replace\n\n\t\tshifts_after = this.overlapping_shift_data['no_overlap'].length;\n\t\tshifts_after_total_time += this.overlapping_shift_data['no_overlap'].reduce( ( a, b ) => parseFloat( a ) + parseFloat( b.total_time ), 0 );\n\t\tif ( this.current_edit_record.overlap_type_id == 10 ) { //Replace\n\t\t\tshifts_after += this.overlapping_shift_data['open_replaced'].length;\n\t\t\tshifts_after_total_time += this.overlapping_shift_data['open_replaced'].reduce( ( a, b ) => parseFloat( a ) + parseFloat( b.total_time ), 0 );\n\t\t} else if ( this.current_edit_record.overlap_type_id == 20 ) { //Split\n\t\t\tshifts_after += split_shifts.length;\n\t\t\tshifts_after_total_time += split_shifts.reduce( ( a, b ) => a + b.total_time, 0 );\n\t\t}\n\t\tif ( this.current_edit_record.is_replace_with_open_shift == true ) {\n\t\t\tshifts_after += this.overlapping_shift_data['open_replaced'].length;\n\t\t\tshifts_after_total_time += this.overlapping_shift_data['open_replaced'].reduce( ( a, b ) => parseFloat( a ) + parseFloat( b.total_time ), 0 );\n\t\t}\n\t\tshifts_before = this.overlapping_shift_data['original'].filter( shift => !shift.not_unique && !shift.do_not_split ).length;\n\t\tshifts_before_total_time = this.overlapping_shift_data['original'].filter( shift => !shift.not_unique && !shift.do_not_split ).reduce( ( a, b ) => parseFloat( a ) + parseFloat( b.total_time ), 0 );\n\t\t$( '#overlapping-shift-total' ).text( '( ' + shifts_before + ' / ' + shifts_after + ' )' );\n\t\t//Group modified shifts by parent (specific starting shift)\n\t\tif ( Array.isArray( split_shifts ) ) {\n\t\t\tlet shift_data_map = {};\n\t\t\tfor ( let i = 0; i < split_shifts.length; i++ ) {\n\t\t\t\tif ( split_shifts[i].split_state === 'no_split' ) {\n\t\t\t\t\t//No change to this shift.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif ( !shift_data_map[split_shifts[i].split_parent] ) {\n\t\t\t\t\tshift_data_map[split_shifts[i].split_parent] = [];\n\t\t\t\t}\n\t\t\t\tshift_data_map[split_shifts[i].split_parent].push( split_shifts[i] );\n\n\t\t\t\t//Check if split overlaps < 50% of parent (original) shift. Only check if split is not already suggested.\n\t\t\t\tif ( suggested_overlap_type_id == 10 ) { //Replace\n\t\t\t\t\tlet parent_shift = this.overlapping_shift_data['original'].find( shift => shift.id === split_shifts[i].split_parent );\n\t\t\t\t\tif ( parent_shift ) {\n\t\t\t\t\t\tlet split_shift_percent = ( parseFloat( split_shifts[i].total_time ) / parseFloat( parent_shift.total_time ) ) * 100;\n\t\t\t\t\t\tif ( split_shift_percent < 50 ) {\n\t\t\t\t\t\t\tsuggested_overlap_type_id = 20; //Split\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\toverlapping_shifts_html += '';\n\n\t\t\tif ( this.current_edit_record.overlap_type_id != suggested_overlap_type_id ) {\n\t\t\t\tlet suggested_overlap_label = suggested_overlap_type_id == 10 ? $.i18n._( 'Replace' ) : $.i18n._( 'Split' );\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t//Make the overlapping icon red if the suggested overlap type is different from the current selected overlap type.\n\t\t\t\t//This is to draw the users' attention.\n\t\t\t\t$( '#overlapping-shift-icon' ).css( 'color', 'red' );\n\t\t\t} else {\n\t\t\t\t$( '#overlapping-shift-icon' ).css( 'color', '' );\n\t\t\t}\n\n\t\t\tif ( this.current_edit_record.overlap_type_id == 20 && split_shifts.length > 0 ) {\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t} else if ( this.current_edit_record.overlap_type_id == 10 && this.overlapping_shift_data['open_replaced'].length > 0 ) {\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t}\n\n\t\t\tif ( _.size( shift_data_map ) > 0 ) {\n\t\t\t\toverlapping_shifts_html += this.getOverlappingShiftHeaderHtml();\n\t\t\t}\n\n\t\t\tfor ( let shift_data in shift_data_map ) {\n\t\t\t\tlet parent_data = this.overlapping_shift_data['original'].find( shift => shift.id === shift_data_map[shift_data][0].split_parent );\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\toverlapping_shifts_html += '';\n\n\t\t\t\tlet table_row_break = false;\n\t\t\t\tfor ( let i = 0; i < shift_data_map[shift_data].length; i++ ) {\n\t\t\t\t\tif ( this.current_edit_record.overlap_type_id == 20 || ( shift_data_map[shift_data][i].split_state === 'new' || shift_data_map[shift_data][i].split_state === 'replaced' ) ) { //Split\n\t\t\t\t\t\tif ( table_row_break === true ) {\n\t\t\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet modified_label = shift_data_map[shift_data][i].split_state === 'new' ? $.i18n._( 'New' ) : $.i18n._( 'Modified' );\n\t\t\t\t\t\tlet cell_class = shift_data_map[shift_data][i].is_absence ? 'overlap-absence' : '';\n\t\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\t\tif ( table_row_break === true ) {\n\t\t\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttable_row_break = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t}\n\n\t\t\tif ( Array.isArray( this.overlapping_shift_data['no_overlap'] ) && this.overlapping_shift_data['no_overlap'].length > 0 ) {\n\t\t\t\toverlapping_shifts_html += ''; //blank row for spacing\n\t\t\t\toverlapping_shifts_html += '';\n\n\t\t\t\tif ( _.size( shift_data_map ) === 0 ) {\n\t\t\t\t\toverlapping_shifts_html += this.getOverlappingShiftHeaderHtml();\n\t\t\t\t}\n\n\t\t\t\tfor ( let i = 0; i < this.overlapping_shift_data['no_overlap'].length; i++ ) {\n\t\t\t\t\tlet tr_class = this.current_edit_record.request_schedule_status_id == 20 ? 'overlap-absence' : '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( this.current_edit_record.is_replace_with_open_shift == true && Array.isArray( this.overlapping_shift_data['open_replaced'] ) && this.overlapping_shift_data['open_replaced'].length > 0 ) {\n\t\t\t\toverlapping_shifts_html += ''; //blank row for spacing\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\tfor ( let i = 0; i < this.overlapping_shift_data['open_replaced'].length; i++ ) {\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t\toverlapping_shifts_html += '';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( this.overlapping_shift_data['original'].length > 0 || this.overlapping_shift_data['no_overlap'].length > 0 ) {\n\t\t\t\toverlapping_shifts_html += ''; //blank row for spacing\n\t\t\t\toverlapping_shifts_html += '';\n\t\t\t} else {\n\t\t\t\toverlapping_shifts_html += '' + overlapping_shifts_html + '';\n\t\t\t}\n\n\t\t\toverlapping_shifts_html += '
' + $.i18n._( 'Suggested Overlapping Shift(s) Mode' ) + ': ' + suggested_overlap_label + '
' + $.i18n._( 'Overlapping Shifts' ) + '
' + $.i18n._( 'Replaced Shifts' ) + '
' + parent_data.start_date + '' + parent_data.start_time + ' - ' + parent_data.end_time + ' = ' + _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( parent_data.total_time ) + '
' + shift_data_map[shift_data][i].start_date + '' + shift_data_map[shift_data][i].start_time + ' - ' + shift_data_map[shift_data][i].end_time + ' = ' + _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( shift_data_map[shift_data][i].total_time ) + ' [' + modified_label + ']
' + $.i18n._( 'New Shifts (Not Overlapping)' ) + '
' + this.overlapping_shift_data['no_overlap'][i].start_date + '' + this.overlapping_shift_data['no_overlap'][i].start_time + ' - ' + this.overlapping_shift_data['no_overlap'][i].end_time + ' = ' + _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( this.overlapping_shift_data['no_overlap'][i].total_time ) + '
' + $.i18n._( 'New Open Shifts' ) + '
' + this.overlapping_shift_data['open_replaced'][i].start_date + '' + this.overlapping_shift_data['open_replaced'][i].start_time + ' - ' + this.overlapping_shift_data['open_replaced'][i].end_time + ' = ' + _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( this.overlapping_shift_data['open_replaced'][i].total_time ) + '
' + $.i18n._( 'Total Shifts' ) + '' + shifts_before + ' = ' + _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( shifts_before_total_time ) + ' ' + shifts_after + ' = ' + _global_Global__WEBPACK_IMPORTED_MODULE_0__/* .Global.getTimeUnit */ .x.getTimeUnit( shifts_after_total_time ) + '
' + $.i18n._( 'No New or Overlapping Shifts' ) + '
';\n\t\t}\n\n\t\tif ( $this.overlapping_shift_info ) {\n\t\t\t$this.overlapping_shift_info.qtip( {\n\t\t\t\tshow: {\n\t\t\t\t\tevent: 'click',\n\t\t\t\t\tdelay: 10,\n\t\t\t\t\teffect: true\n\t\t\t\t},\n\t\t\t\thide: {\n\t\t\t\t\tevent: ['unfocus click'],\n\t\t\t\t},\n\t\t\t\tstyle: {\n\t\t\t\t\twidth: 525, //Dynamically changing the width causes display bugs when switching between Absence Policies and thereby widths.\n\t\t\t\t\tclasses: 'overlapping-info-display'\n\t\t\t\t},\n\t\t\t\tcontent: overlapping_shifts_html,\n\t\t\t} );\n\t\t}\n\t}\n\n\tgetOverlappingShiftHeaderHtml() {\n\t\treturn `\n\t\t\t\t\t` + $.i18n._( 'Date' ) + `\n\t\t\t\t\t` + $.i18n._( 'Before' ) + `\n\t\t\t\t\t` + $.i18n._( 'After' ) + `\n\t\t\t\t\n\t\t\t\t`;\n\t}\n\n\t// Creates the record shipped to the API at setMesssage\n\tuniformMessageVariable( records ) {\n\t\tvar msg = {};\n\n\t\tmsg.subject = this.edit_view_ui_dic['subject'].getValue();\n\t\tmsg.body = this.edit_view_ui_dic['body'].getValue();\n\t\tmsg.object_id = this.current_edit_record['id'];\n\t\tmsg.object_type_id = 50;\n\n\t\treturn msg;\n\t}\n\n\tgetRequestTabHtml() {\n\t\treturn `\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t
\n\t\t\t
\n\t\t
`;\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMjM0My5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7O0FBQXlDOztBQUVsQztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDtBQUNBO0FBQ0E7QUFDQSxJQUFJOztBQUVKO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0EsbUJBQW1CLFNBQVM7QUFDNUI7O0FBRUE7QUFDQSxJQUFJLENBQUM7QUFDTDtBQUNBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQSxtQ0FBbUMscUdBQTJCOztBQUU5RDtBQUNBO0FBQ0E7O0FBRUEsS0FBS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