1 line
125 KiB
JavaScript
1 line
125 KiB
JavaScript
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["my_account-request-RequestViewController"],{926:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RequestViewController\": () => (/* binding */ RequestViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass RequestViewController extends RequestViewCommonController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#request_view_container',\n\n\t\t\ttype_array: null,\n\t\t\trequest_type_array: null,\n\t\t\tstatus_array: null,\n\n\t\t\tapi_request_schedule: null,\n\t\t\tauthorization_api: null,\n\t\t\tschedule_api: null,\n\t\t\thierarchy_type_id: false,\n\n\t\t\tpunch_tag_api: null,\n\t\t\tdefault_punch_tag: [],\n\t\t\tprevious_punch_tag_selection: [],\n\n\t\t\toverlapping_shift_data: {},\n\n\t\t\tmessages: 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 = 'RequestEditView.html';\n\t\tthis.permission_id = 'request';\n\t\tthis.viewId = 'Request';\n\t\tthis.script_name = 'RequestView';\n\t\tthis.table_name_key = 'request';\n\t\tthis.context_menu_name = $.i18n._( 'Requests' );\n\t\tthis.navigation_label = $.i18n._( 'Request' );\n\t\tthis.api = TTAPI.APIRequest;\n\t\tthis.api_absence_policy = TTAPI.APIAbsencePolicy;\n\t\tthis.api_schedule = TTAPI.APISchedule;\n\t\tthis.message_control_api = TTAPI.APIMessageControl;\n\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tthis.api_request_schedule = TTAPI.APIRequestSchedule;\n\t\t\tthis.schedule_api = TTAPI.APISchedule;\n\t\t}\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.job_api = TTAPI.APIJob;\n\t\t\tthis.job_item_api = TTAPI.APIJobItem;\n\t\t\tthis.punch_tag_api = TTAPI.APIPunchTag;\n\t\t}\n\n\t\tthis.authorization_api = TTAPI.APIAuthorization;\n\n\t\tthis.initPermission();\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\t// override allows a callback after initOptions when run as sub view (from EmployeeViewController)\n\tinitOptions( callBack ) {\n\n\t\tvar options = [\n\t\t\t{ option_name: 'status' },\n\t\t\t{ option_name: 'type' }\n\t\t];\n\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\toptions.push( { option_name: 'overlap_type', api: TTAPI.APIRequestSchedule } );\n\t\t}\n\n\t\tthis.initDropDownOptions( options, function( result ) {\n\n\t\t\tif ( callBack ) {\n\t\t\t\tcallBack( result ); // First to initialize drop down options, and then to initialize edit view UI.\n\t\t\t}\n\n\t\t} );\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar tab_model = {\n\t\t\t'tab_request': { 'label': $.i18n._( 'Message' ) },\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\t//This hides the audit tab as this view is always used for creating/replying to an existing request.\n\t\t//For some reason removing 'tab_audit' from the model above results in a blank tab appearing.\n\t\tvar tab_audit_label = this.edit_view.find( 'a[ref=tab_audit]' );\n\t\ttab_audit_label.css( 'display', 'none' );\n\n\t\t//Tab 0 start\n\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\tvar tab_request_column2 = tab_request.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_request_column1 );\n\n\t\t// Subject\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'subject', width: 359 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Subject' ), form_item_input, tab_request_column1, '' );\n\n\t\t// Body\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\n\t\tform_item_input.TTextArea( { field: 'body', width: 600, height: 400 } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Body' ), form_item_input, tab_request_column1, '', null, null, true );\n\n\t\ttab_request_column2.css( 'display', 'none' );\n\t}\n\n\tbuildAddViewUI() {\n\t\tsuper.buildEditViewUI();\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_request': { 'label': $.i18n._( 'Request' ), 'is_multi_column': true },\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\t//This hides the audit tab as this view is always used for creating/replying to an existing request.\n\t\t//For some reason removing 'tab_audit' from the model above results in a blank tab appearing.\n\t\tvar tab_audit_label = this.edit_view.find( 'a[ref=tab_audit]' );\n\t\ttab_audit_label.css( 'display', 'none' );\n\n\t\t//Tab 0 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\tvar tab_request_column2 = tab_request.find( '.second-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\t\tthis.edit_view_tabs[0].push( tab_request_column1 );\n\t\tthis.edit_view_tabs[0].push( tab_request_column2 );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\t\tvar label;\n\n\t\t// Employee\n\t\tform_item_input = Global.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\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\t\tform_item_input.TComboBox( { field: 'type_id', set_empty: false } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_request_column1 );\n\n\t\t// Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'date_stamp' } );\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tlabel = $( '<span class=\\'widget-right-label\\'> ' + $.i18n._( '(Use the first or only date affected by this request)' ) + '</span>' );\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Date' ), form_item_input, tab_request_column1, '', widgetContainer );\n\n\t\tif ( Global.getProductEdition() >= 15 && PermissionManager.validate( 'request', 'add_advanced' ) ) {\n\t\t\t//Working Status\n\t\t\tform_item_input = Global.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\n\t\t\t//Absence Policy\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIAbsencePolicy,\n\t\t\t\tcustomSearchFilter: function() {\n\t\t\t\t\treturn { filter_data: { user_id: LocalCacheData.getLoginUser().id } };\n\t\t\t\t},\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} );\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.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'available_balance' } );\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box available-balance-h-box\\'></div>' );\n\t\t\tthis.available_balance_info = $( '<span class=\"available-balance-info tticon tticon-info_black_24dp\"></span>' );\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.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.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.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_sun_checkbox.TCheckbox( { field: 'sun' } );\n\n\t\t\tvar form_item_mon_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_mon_checkbox.TCheckbox( { field: 'mon' } );\n\n\t\t\tvar form_item_tue_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_tue_checkbox.TCheckbox( { field: 'tue' } );\n\n\t\t\tvar form_item_wed_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_wed_checkbox.TCheckbox( { field: 'wed' } );\n\n\t\t\tvar form_item_thu_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_thu_checkbox.TCheckbox( { field: 'thu' } );\n\n\t\t\tvar form_item_fri_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_fri_checkbox.TCheckbox( { field: 'fri' } );\n\n\t\t\tvar form_item_sat_checkbox = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_sat_checkbox.TCheckbox( { field: 'sat' } );\n\n\t\t\twidgetContainer = $( '<div></div>' );\n\n\t\t\tvar sun = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Sun' ) + ' <br> ' + ' </span>' );\n\t\t\tvar mon = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Mon' ) + ' <br> ' + ' </span>' );\n\t\t\tvar tue = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Tue' ) + ' <br> ' + ' </span>' );\n\t\t\tvar wed = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Wed' ) + ' <br> ' + ' </span>' );\n\t\t\tvar thu = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Thu' ) + ' <br> ' + ' </span>' );\n\t\t\tvar fri = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Fri' ) + ' <br> ' + ' </span>' );\n\t\t\tvar sat = $( '<span class=\\'widget-top-label\\'> ' + $.i18n._( 'Sat' ) + ' <br> ' + ' </span>' );\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\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.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.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.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'total_time' } );\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\t\tlabel = $( '<span class=\\'widget-right-label\\' id=\\'total_info\\'></span>' );\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.getProductEdition() >= 15 ) && this.overlappingShiftUIValidate() == true ) {\n\t\t\t\t//Override / Split shift\n\t\t\t\tvar form_item_input = Global.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 = $( '<div class=\\'widget-h-box overlapping-shift-h-box\\'></div>' );\n\t\t\t\tthis.overlapping_shift_info = $( '<span style=\"position: relative; top: -3px; left: 3px;\" id=\"overlapping-shift-total\"></span><span id=\"overlapping-shift-icon\" class=\"overlapping-shift-info tticon tticon-info_black_24dp\"></span>' );\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\t\t\t}\n\n\t\t\t//Schedule Policy\n\t\t\tform_item_input = Global.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.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\tif ( this.show_branch_ui ) {\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Branch' ), form_item_input, tab_request_column1 );\n\t\t\t}\n\n\t\t\t//Dept\n\t\t\tform_item_input = Global.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\n\t\t\tif ( this.show_department_ui ) {\n\t\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Department' ), form_item_input, tab_request_column1 );\n\t\t\t}\n\n\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t//Job\n\t\t\t\tform_item_input = Global.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.default_item },\n\t\t\t\t\t\t{ value: '-2', label: Global.selected_item }\n\t\t\t\t\t]\n\t\t\t\t} );\n\n\t\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\t\tvar job_coder = Global.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\t//invalid permissions\n\t\t\t\t\tthis.detachElement( 'job_id' );\n\t\t\t\t}\n\t\t\t\t//Job Item\n\t\t\t\tform_item_input = Global.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.default_item },\n\t\t\t\t\t\t{ value: '-2', label: Global.selected_item }\n\t\t\t\t\t]\n\t\t\t\t} );\n\n\t\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\t\tvar job_item_coder = Global.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\t//invalid permissions\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.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 = $( '<div class=\\'widget-h-box\\'></div>' );\n\n\t\t\t\tvar punch_tag_coder = Global.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._( '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\t//invalid permissions\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\t// Message\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'message', width: 400, height: 300 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Reason / Message' ), form_item_input, tab_request_column1, '', null, null, true );\n\n\t\t//hide initially hidden fields.\n\t\t//tab_request_column2.css( 'display', 'none' );\n\t\tif ( Global.getProductEdition() >= 15 && PermissionManager.validate( 'request', 'add_advanced' ) ) {\n\t\t\tthis.edit_view_ui_dic.available_balance.parents( '.edit-view-form-item-div' ).hide();\n\t\t\tthis.hideAdvancedFields();\n\t\t}\n\n\t\tthis.onTypeChanged();\n\t\tthis.onWorkingStatusChanged();\n\t}\n\n\tbuildSearchFields() {\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._( 'Type' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'type_id',\n\t\t\t\tmultiple: true,\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._( 'Start Date' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'start_date',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.DATE_PICKER\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'End Date' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'end_date',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: false,\n\t\t\t\tform_item_type: FormItemType.DATE_PICKER\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Status' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'status_id',\n\t\t\t\tmultiple: true,\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\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['default'],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'New' ),\n\t\t\t\t\tid: 'add',\n\t\t\t\t\tgroup: 'editor',\n\t\t\t\t\tvue_icon: 'tticon tticon-add_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._( 'View' ),\n\t\t\t\t\tid: 'view',\n\t\t\t\t\tgroup: 'editor',\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\tsort_order: 1010\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Reply' ),\n\t\t\t\t\tid: 'edit',\n\t\t\t\t\tvue_icon: 'tticon tticon-reply_black_24dp'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Send' ),\n\t\t\t\t\tid: 'send',\n\t\t\t\t\tgroup: 'editor',\n\t\t\t\t\tvue_icon: 'tticon tticon-send_black_24dp'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Delete' ),\n\t\t\t\t\tid: 'delete_icon',\n\t\t\t\t\taction_group: 'delete',\n\t\t\t\t\tgroup: 'editor',\n\t\t\t\t\tvue_icon: 'tticon tticon-delete_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._( 'Delete & Next' ),\n\t\t\t\t\tid: 'delete_and_next',\n\t\t\t\t\taction_group: 'delete',\n\t\t\t\t\tgroup: 'editor',\n\t\t\t\t\tvue_icon: 'tticon tticon-delete_black_24dp'\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: 'editor',\n\t\t\t\t\tsort_order: 1990\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\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\tmenu_align: 'right',\n\t\t\t\t\tvue_icon: 'tticon tticon-file_upload_black_24dp',\n\t\t\t\t\tsort_order: 100\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},\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tsetCurrentEditRecordData( current_edit_record ) {\n\t\tvar $this = this;\n\t\tif ( current_edit_record ) {\n\t\t\tthis.current_edit_record = current_edit_record;\n\t\t}\n\n\t\tif ( !this.current_edit_record ) {\n\t\t\tthis.current_edit_record = {};\n\t\t}\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_add ) {\n\t\t\t\t\t\t\twidget.setValue( LocalCacheData.loginUser.first_name + ' ' + LocalCacheData.loginUser.last_name );\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['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 'subject':\n\t\t\t\t\t\t// Error: Uncaught TypeError: Cannot read property '0' of null in /interface/html5/#!m=Request&a=view&id=13185&tab=Request line 505\n\t\t\t\t\t\tif ( this.is_edit && this.messages ) {\n\t\t\t\t\t\t\twidget.setValue( 'Re: ' + this.messages[0].subject );\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\tcase 'punch_tag_id':\n\t\t\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\t\t\twidget.setValue( this.current_edit_record[key] );\n\t\t\t\t\t\t\tthis.previous_punch_tag_selection = this.current_edit_record[key];\n\n\t\t\t\t\t\t\tvar punch_tag_widget = widget;\n\t\t\t\t\t\t\tTTPromise.wait( null, null, function() {\n\t\t\t\t\t\t\t\t//Update default args for punch tags AComboBox last as they rely on data from job, job item and related fields.\n\t\t\t\t\t\t\t\tvar args = {};\n\t\t\t\t\t\t\t\targs.filter_data = $this.getPunchTagFilterData();\n\t\t\t\t\t\t\t\tpunch_tag_widget.setDefaultArgs( args );\n\t\t\t\t\t\t\t} );\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\n\t\t//a new request comes from the current user.\n\t\tif ( this.is_add ) {\n\t\t\tthis.current_edit_record.user_id = LocalCacheData.loginUser.id;\n\t\t}\n\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tsetEditViewDataDone() {\n\t\tvar $this = this;\n\t\tsuper.setEditViewDataDone();\n\t\tif ( this.is_viewing ) {\n\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\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t$this.getOverlappingShifts();\n\t\t}\n\t}\n\n\tinitViewingView() {\n\t\tsuper.initViewingView();\n\t\tif ( this.edit_view_ui_dic.message ) {\n\t\t\tthis.edit_view_ui_dic.message.parents( '.edit-view-form-item-div' ).hide();\n\t\t}\n\t\tif ( Global.getProductEdition() >= 15 && ( this.edit_view_ui_dic.type_id == 30 || this.edit_view_ui_dic.type_id == 40 ) ) {\n\t\t\tvar dow = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];\n\t\t\tvar one_selected = false;\n\t\t\tfor ( var key in this.current_edit_record ) {\n\t\t\t\tif ( dow.indexOf( key ) > -1 ) {\n\t\t\t\t\tfor ( var i = 0; i < 7; i++ ) {\n\t\t\t\t\t\tif ( this.current_edit_record[key] !== 0 && this.current_edit_record[key] !== false ) {\n\t\t\t\t\t\t\tone_selected = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( one_selected ) {\n\t\t\t\t\t\tthis.edit_view_ui_dic['sun'].parents( '.edit-view-form-item-div' ).show();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.edit_view_ui_dic['sun'].parents( '.edit-view-form-item-div' ).hide();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tsetURL() {\n\n\t\tif ( LocalCacheData.current_doing_context_action === 'edit' ) {\n\t\t\tLocalCacheData.current_doing_context_action = '';\n\t\t\treturn;\n\t\t}\n\n\t\tsuper.setURL();\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.setDefaultMenuSendIcon( 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.setDefaultMenuEditEmployeeIcon( context_btn, grid_selected_length, 'user' );\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 '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}\n\t}\n\n\tsetDefaultMenuCancelIcon( context_btn, grid_selected_length, pId ) {\n\t\tif ( !this.sub_view_mode && !this.is_viewing ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetDefaultMenuExportIcon( context_btn, grid_selected_length, pId ) {\n\t\tif ( this.edit_only_mode || this.is_viewing || this.is_edit || this.is_add ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t} else if ( grid_selected_length == 0 || this.grid == undefined ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuAddIcon( context_btn, pId ) {\n\t\tsuper.setEditMenuAddIcon( context_btn, pId );\n\n\t\tif ( this.is_edit || this.is_add ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuDeleteAndNextIcon( context_btn, pId ) {\n\t\tif ( this.is_edit || this.is_add ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuNavViewIcon( context_btn, pId ) {\n\t\tif ( this.is_edit || this.is_add ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuDeleteIcon( context_btn, pId ) {\n\t\tif ( this.is_edit || this.is_add ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tonTypeChanged( arg ) {\n\t\tif ( this.current_edit_record && Global.getProductEdition() >= 15 && PermissionManager.validate( 'request', 'add_advanced' ) && ( this.current_edit_record.type_id == 30 || this.current_edit_record.type_id == 40 ) ) { //schedule adjustment || absence selected\n\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' ).hide();\n\t\t\t}\n\t\t\tif ( this.current_edit_record.date_stamp != undefined && this.current_edit_record.start_date == '' ) {\n\t\t\t\tthis.edit_view_ui_dic.start_date.setValue( this.current_edit_record.date_stamp );\n\t\t\t\tthis.current_edit_record.start_date = this.current_edit_record.date_stamp;\n\t\t\t}\n\t\t\tif ( this.current_edit_record.date_stamp != undefined && this.current_edit_record.end_date == '' ) {\n\t\t\t\tthis.edit_view_ui_dic.end_date.setValue( this.current_edit_record.date_stamp );\n\t\t\t\tthis.current_edit_record.end_date = this.current_edit_record.date_stamp;\n\t\t\t}\n\t\t\tthis.showAdvancedFields( false ); //Don't update schedule total time as it will be done lower down in setRequestFormDefaultData();\n\n\t\t\tif ( this.edit_view_ui_dic.type_id.getValue() == 30 ) {\n\t\t\t\tthis.edit_view_ui_dic.request_schedule_status_id.setValue( 20 );\n\t\t\t} else if ( this.edit_view_ui_dic.type_id.getValue() == 40 ) {\n\t\t\t\tthis.edit_view_ui_dic.request_schedule_status_id.setValue( 10 );\n\t\t\t}\n\n\t\t\tif ( arg ) {\n\t\t\t\targ.request_schedule_status_id = this.edit_view_ui_dic.request_schedule_status_id.getValue(); //arg is passed on setRequestFormDefaultData() below, so make sure it matches the UI here.\n\t\t\t}\n\n\t\t\tthis.onWorkingStatusChanged();\n\n\t\t\tvar $this = this;\n\t\t\tthis.setRequestFormDefaultData( arg, function() {\n\t\t\t\t$this.getAvailableBalance();\n\t\t\t\t$this.setCurrentEditRecordData( $this.current_edit_record );\n\t\t\t\t$this.getScheduleTotalTime();\n\t\t\t} );\n\t\t} else {\n\n\t\t\tthis.hideAdvancedFields();\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.onWorkingStatusChanged();\n\t\t}\n\t}\n\n\tsetRequestFormDefaultData( data, callback_function ) {\n\t\tif ( Global.getProductEdition() >= 15 && PermissionManager.validate( 'request', 'add_advanced' ) && ( this.current_edit_record.type_id == 30 || this.current_edit_record.type_id == 40 ) ) {\n\t\t\tif ( data == undefined ) {\n\t\t\t\tvar $this = this;\n\t\t\t\tthis.enable_validation = false;\n\t\t\t\tthis.setUIWidgetFieldsToCurrentEditRecord();\n\t\t\t\tvar filter = this.uniformVariable( this.buildDataForAPI( this.current_edit_record ) );\n\n\t\t\t\tthis.api_request_schedule.getRequestScheduleDefaultData( filter, {\n\t\t\t\t\tonResult: function( res ) {\n\n\t\t\t\t\t\tdata = res.getResult();\n\t\t\t\t\t\tdata.request_schedule_status_id = data.status_id;\n\t\t\t\t\t\tdata.date_stamp = data.start_date;\n\n\t\t\t\t\t\t//force = true is required to set the current_edit_record and populate edit_view_ui_dic\n\t\t\t\t\t\t$this.setDefaultData( data, true );\n\t\t\t\t\t\tif ( callback_function ) {\n\t\t\t\t\t\t\tcallback_function();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tdata.date_stamp = data.start_date;\n\t\t\t\tdata = this.buildDataFromAPI( data );\n\t\t\t\t//force = true is required to set the current_edit_record and populate edit_view_ui_dic\n\t\t\t\tthis.setDefaultData( data, true );\n\t\t\t\tif ( callback_function ) {\n\t\t\t\t\tcallback_function();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonAvailableBalanceChange() {\n\t\tif ( Global.getProductEdition() >= 15 && PermissionManager.validate( 'request', 'add_advanced' ) ) {\n\t\t\tif ( this.edit_view_ui_dic && this.edit_view_ui_dic.absence_policy_id && this.edit_view_ui_dic.request_schedule_status_id.getValue() == 20 && this.edit_view_ui_dic.absence_policy_id.getValue() != TTUUID.zero_id ) {\n\t\t\t\tthis.getAvailableBalance();\n\t\t\t} else if ( this.edit_view_ui_dic && 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\t//post hook for onSaveResult\n\tonSaveDone( result ) {\n\t\tvar retval;\n\t\tif ( this.is_edit ) {\n\t\t\tthis.onViewClick( this.current_edit_record.id );\n\t\t\tretval = false;\n\t\t} else {\n\t\t\tretval = true;\n\t\t}\n\t\t$().TFeedback( {\n\t\t\tsource: 'Send'\n\t\t} );\n\t\t//If request was added from the TimeSheet view, refresh the TimeSheet.\n\t\tif ( LocalCacheData.current_open_primary_controller && LocalCacheData.current_open_primary_controller.viewId === 'TimeSheet' ) {\n\t\t\tLocalCacheData.current_open_primary_controller.search();\n\t\t}\n\t\treturn retval;\n\t}\n\n\tuniformVariable( records ) {\n\t\tif ( typeof records === 'object' ) {\n\t\t\trecords.user_id = LocalCacheData.loginUser.id;\n\t\t\trecords.first_name = LocalCacheData.loginUser.first_name;\n\t\t\trecords.last_name = LocalCacheData.loginUser.last_name;\n\t\t}\n\n\t\tif ( this.is_add ) {\n\t\t\trecords = this.buildDataForAPI( records );\n\t\t} else if ( this.is_edit ) {\n\t\t\tvar msg = this.uniformMessageVariable( records );\n\n\t\t\tif ( records && records.request_schedule ) {\n\t\t\t\tmsg.request_schedule = records.request_schedule;\n\t\t\t}\n\n\t\t\treturn msg;\n\t\t}\n\n\t\treturn records;\n\t}\n\n\tonSaveClick( ignoreWarning ) {\n\t\tvar $this = this;\n\t\tLocalCacheData.current_doing_context_action = 'save';\n\t\tif ( !Global.isSet( ignoreWarning ) ) {\n\t\t\tignoreWarning = false;\n\t\t}\n\n\t\tfor ( var key in $this.current_edit_record ) {\n\t\t\tif ( $this.edit_view_ui_dic[key] != undefined ) {\n\t\t\t\t$this.current_edit_record[key] = $this.edit_view_ui_dic[key].getValue();\n\t\t\t}\n\t\t}\n\n\t\tif ( this.is_add ) {\n\t\t\t// //format data as expected by API\n\t\t\trecord = this.uniformVariable( $this.current_edit_record );\n\n\t\t\tthis.api['set' + this.api.key_name]( record, false, ignoreWarning, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.onSaveResult( result );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( this.is_edit ) {\n\t\t\tvar record = {};\n\t\t\tthis.is_add = false;\n\t\t\tthis.setCurrentEditRecordData();\n\t\t\trecord = this.uniformVariable( this.current_edit_record );\n\t\t\tEmbeddedMessage.reply( [record], ignoreWarning, function( result ) {\n\t\t\t\t\tif ( result.isValid() ) {\n\t\t\t\t\t\tvar id = $this.current_edit_record.id;\n\t\t\t\t\t\t//see #2224 - Unable to get property 'find' of undefined\n\t\t\t\t\t\t$this.removeEditView();\n\t\t\t\t\t\t$this.onViewClick( id );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.setErrorTips( result );\n\t\t\t\t\t\t$this.setErrorMenu();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t}\n\n\tsearch( set_default_menu, page_action, page_number, callBack ) {\n\t\tthis.refresh_id = null;\n\t\tsuper.search( set_default_menu, page_action, page_number, callBack );\n\t}\n\n\tsetEditMenuEditIcon( context_btn ) {\n\t\tif ( !this.editPermissionValidate( 'request' ) || this.edit_only_mode || this.is_mass_editing ) {\n\t\t\t//Not shown in edit only mode or mass edit. Mass edit should only show mass edit (need to set that part in mass edit icon).\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\n\t\tif ( !this.is_viewing || !this.editOwnerOrChildPermissionValidate( 'request' ) ) {\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( 'request' ) || this.edit_only_mode || ( !this.is_edit || !this.is_viewing ) ) {\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, false );\n\t}\n\n\tsetDefaultMenuScheduleIcon( context_btn, grid_selected_length, pId ) {\n\t\tif ( !PermissionManager.checkTopLevelPermission( 'Schedule' ) || 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\tsetDefaultMenuSendIcon( context_btn, grid_selected_length, pId ) {\n\t\tif ( !this.addPermissionValidate( pId ) || this.edit_only_mode || ( !this.is_edit || !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\tsetDefaultMenuEditEmployeeIcon( context_btn, grid_selected_length ) {\n\t\tif ( !this.editChildPermissionValidate( 'user' ) ) {\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\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'timesheet':\n\t\t\tcase 'schedule':\n\t\t\tcase 'edit_employee':\n\t\t\t\tthis.onNavigationClick( id );\n\t\t\t\tbreak;\n\t\t\tcase 'send':\n\t\t\t\tthis.onSaveClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetEditViewWidgetsMode() {\n\t\tvar did_clean = false;\n\t\tfor ( var key in this.edit_view_ui_dic ) {\n\t\t\tvar widget = this.edit_view_ui_dic[key];\n\t\t\twidget.css( 'opacity', 1 );\n\t\t\tvar column = widget.parent().parent().parent();\n\t\t\tif ( !column.hasClass( 'v-box' ) ) {\n\t\t\t\tif ( !did_clean ) {\n\t\t\t\t\tdid_clean = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ( this.is_viewing ) {\n\t\t\t\tif ( Global.isSet( widget.setEnabled ) ) {\n\t\t\t\t\twidget.setEnabled( false );\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ( Global.isSet( widget.setEnabled ) ) {\n\t\t\t\t\twidget.setEnabled( true );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tvar $this = this;\n\t\tthis.collectUIDataToCurrentEditRecord();\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\t\tthis.current_edit_record[key] = c_value;\n\t\tvar needs_callback = false;\n\n\t\tswitch ( key ) {\n\t\t\tcase 'job_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic['job_quick_search'].setValue( target.getValue( true ) ? ( target.getValue( true ).manual_id ? target.getValue( true ).manual_id : '' ) : '' );\n\t\t\t\t\tthis.setJobItemValueWhenJobChanged( target.getValue( true ), 'job_item_id' );\n\t\t\t\t\tthis.edit_view_ui_dic['job_quick_search'].setCheckBox( true );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_item_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic['job_item_quick_search'].setValue( target.getValue( true ) ? ( target.getValue( true ).manual_id ? target.getValue( true ).manual_id : '' ) : '' );\n\t\t\t\t\tthis.edit_view_ui_dic['job_item_quick_search'].setCheckBox( true );\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'punch_tag_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tif ( c_value !== TTUUID.zero_id && c_value !== false && c_value.length > 0 ) {\n\t\t\t\t\t\tthis.setPunchTagQuickSearchManualIds( target.getSelectItems() );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthis.edit_view_ui_dic['punch_tag_quick_search'].setValue( '' );\n\t\t\t\t\t}\n\t\t\t\t\t$this.previous_punch_tag_selection = c_value;\n\t\t\t\t\t//Reset source data to make sure correct punch tags are always shown.\n\t\t\t\t\tthis.edit_view_ui_dic['punch_tag_id'].setSourceData( null );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'user_id':\n\t\t\tcase 'branch_id':\n\t\t\tcase 'department_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.setPunchTagValuesWhenCriteriaChanged( this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'job_quick_search':\n\t\t\tcase 'job_item_quick_search':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onJobQuickSearch( key, c_value, 'job_id', 'job_item_id' );\n\t\t\t\t\tTTPromise.wait( 'BaseViewController', 'onJobQuickSearch', function() {\n\t\t\t\t\t\t$this.setPunchTagValuesWhenCriteriaChanged( $this.getPunchTagFilterData(), 'punch_tag_id' );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'punch_tag_quick_search':\n\t\t\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\t\t\tthis.onPunchTagQuickSearch( c_value, this.getPunchTagFilterData(), 'punch_tag_id' );\n\n\t\t\t\t\t//Don't validate immediately as onJobQuickSearch is doing async API calls, and it would cause a guaranteed validation failure.\n\t\t\t\t\tdoNotValidate = true;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'type_id':\n\t\t\t\t// Set absence_policy_id to zero id to prevent available balance field showing when switching to a none absence request type.\n\t\t\t\t// Also prevents available balance sometimes showing the wrong value due to mismatch in select menu and current_edit_record.\n\t\t\t\tif ( this.edit_view_ui_dic.absence_policy_id && ( this.current_edit_record.type_id === 30 || this.current_edit_record.type_id === 40 ) ) {\n\t\t\t\t\tthis.edit_view_ui_dic.absence_policy_id.setValue( TTUUID.zero_id );\n\t\t\t\t\tthis.current_edit_record.absence_policy_id = TTUUID.zero_id;\n\t\t\t\t}\n\t\t\t\tdoNotValidate = true;\n\t\t\t\tthis.onTypeChanged();\n\t\t\t\tbreak;\n\t\t\tcase 'overlap_type_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\tthis.getOverlappingShifts();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'date_stamp':\n\t\t\t\tthis.onDateStampChanged();\n\t\t\t\tbreak;\n\t\t\tcase 'request_schedule_status_id':\n\t\t\t\tthis.onWorkingStatusChanged();\n\t\t\t\tbreak;\n\t\t\tcase 'start_date':\n\t\t\t\tthis.current_edit_record.start_date = this.edit_view_ui_dic.start_date.getValue();\n\t\t\t\tthis.current_edit_record.date_stamp = this.edit_view_ui_dic.start_date.getValue();\n\t\t\t\tthis.onStartDateChanged();\n\t\t\t\tthis.setRequestFormDefaultData( null, function() {\n\t\t\t\t\tfinishFormItemChange();\n\t\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\t\t$this.getOverlappingShifts();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tneeds_callback = true;\n\t\t\t\tbreak;\n\t\t\tcase 'end_date':\n\t\t\t\tthis.current_edit_record.end_date = this.edit_view_ui_dic.end_date.getValue();\n\t\t\t\tthis.setRequestFormDefaultData( null, function() {\n\t\t\t\t\tfinishFormItemChange();\n\t\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\t\t$this.getOverlappingShifts();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tneeds_callback = true;\n\t\t\t\tbreak;\n\t\t\tcase 'start_time':\n\t\t\tcase 'end_time':\n\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\tthis.getOverlappingShifts();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'sun':\n\t\t\tcase 'mon':\n\t\t\tcase 'tue':\n\t\t\tcase 'wed':\n\t\t\tcase 'thu':\n\t\t\tcase 'fri':\n\t\t\tcase 'sat':\n\t\t\t\tthis.getScheduleTotalTime();\n\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\tthis.getOverlappingShifts();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 'schedule_policy_id':\n\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\t$this.getOverlappingShifts();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase'absence_policy_id':\n\t\t\t\tthis.selected_absence_policy_record = this.edit_view_ui_dic.absence_policy_id.getValue();\n\t\t\t\tbreak;\n\t\t\tcase 'is_replace_with_open_shift':\n\t\t\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t\t\tthis.getOverlappingShifts();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( !needs_callback ) {\n\t\t\tfinishFormItemChange();\n\t\t}\n\n\t\tfunction finishFormItemChange() {\n\t\t\tif ( key === 'date_stamp' ||\n\t\t\t\tkey === 'start_date_stamps' ||\n\t\t\t\tkey === 'start_date' ||\n\t\t\t\tkey === 'end_date' ||\n\t\t\t\tkey === 'start_date_stamp' ||\n\t\t\t\tkey === 'start_time' ||\n\t\t\t\tkey === 'end_time' ||\n\t\t\t\tkey === 'schedule_policy_id' ||\n\t\t\t\tkey === 'absence_policy_id' ) {\n\n\t\t\t\tif ( $this.current_edit_record['date_stamp'] !== '' &&\n\t\t\t\t\t$this.current_edit_record['start_time'] !== '' &&\n\t\t\t\t\t$this.current_edit_record['end_time'] !== '' ) {\n\n\t\t\t\t\t$this.getScheduleTotalTime();\n\t\t\t\t} else {\n\t\t\t\t\t$this.onAvailableBalanceChange();\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( !doNotValidate ) {\n\t\t\t\t$this.validate();\n\t\t\t}\n\t\t\t$this.setEditMenu();\n\t\t}\n\t}\n\n\tvalidate() {\n\t\tvar $this = this;\n\t\tvar record = this.current_edit_record;\n\t\trecord = this.uniformVariable( record );\n\t\tvar api = this.message_control_api;\n\t\tif ( this.is_add ) {\n\t\t\trecord = this.buildDataForAPI( record );\n\t\t\tapi = this.api;\n\t\t}\n\n\t\tapi['validate' + api.key_name]( record, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.validateResult( result );\n\t\t\t}\n\t\t} );\n\t}\n\n\tonAddClick( data ) {\n\t\tTTPromise.add( 'Request', 'add' );\n\t\tTTPromise.wait();\n\t\tvar $this = this;\n\t\tif ( this.edit_view ) {\n\t\t\tthis.removeEditView();\n\t\t}\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\tthis.openEditView();\n\t\tthis.buildAddViewUI();\n\t\t//Error: Uncaught TypeError: undefined is not a function in /interface/html5/views/BaseViewController.js?v=8.0.0-20141117-111140 line 897\n\t\tif ( $this.api && typeof $this.api['get' + $this.api.key_name + 'DefaultData'] === 'function' ) {\n\t\t\t$this.api['get' + $this.api.key_name + 'DefaultData']( {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\tif ( data ) {\n\t\t\t\t\t\t//data passed should overwrite the default data from the API.\n\t\t\t\t\t\tresult = $.extend( {}, result.getResult(), data );\n\t\t\t\t\t}\n\t\t\t\t\t$this.onAddResult( result );\n\t\t\t\t\t$this.onDateStampChanged();\n\t\t\t\t\tif ( result.type_id ) {\n\t\t\t\t\t\t$this.onTypeChanged( result );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.getScheduleTotalTime(); //This is called as part of onTypeChanged(), so it doesn't need to be done twice.\n\t\t\t\t\t}\n\n\t\t\t\t\tTTPromise.resolve( 'Request', 'add' );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t//To be called only by external scripts creating requests (timesheet and schedule at this time)\n\topenAddView( data_array ) {\n\t\tthis.sub_view_mode = true;\n\t\tthis.edit_only_mode = true;\n\t\tvar $this = this;\n\t\tthis.initOptions( function() {\n\t\t\t$this.onAddClick( data_array );\n\t\t} );\n\t}\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiOTI2LmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFPO0FBQ1AsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUEsNkJBQTZCOztBQUU3QjtBQUNBLElBQUk7O0FBRUo7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLDJCQUEyQixDQUFDO0FBQzVCLDBCQUEwQixDQUFDO0FBQzNCO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0EsS0FBSyx1QkFBdU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