1 line
72 KiB
JavaScript
1 line
72 KiB
JavaScript
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-recurring_schedule_control-RecurringScheduleControlViewController"],{869:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"RecurringScheduleControlViewController\": () => (/* binding */ RecurringScheduleControlViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass RecurringScheduleControlViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#recurring_schedule_control_view_container',\n\n\n\t\t\tuser_status_array: null,\n\n\t\t\tuser_group_array: null,\n\t\t\tuser_api: null,\n\n\t\t\tuser_group_api: null\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'RecurringScheduleControlEditView.html';\n\t\tthis.permission_id = 'recurring_schedule';\n\t\tthis.viewId = 'RecurringScheduleControl';\n\t\tthis.script_name = 'RecurringScheduleControlView';\n\t\tthis.table_name_key = 'recurring_schedule_control';\n\t\tthis.context_menu_name = $.i18n._( 'Recurring Schedules' );\n\t\tthis.navigation_label = $.i18n._( 'Recurring Schedule' );\n\t\tthis.api = TTAPI.APIRecurringScheduleControl;\n\t\tthis.user_api = TTAPI.APIUser;\n\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\t\tthis.event_bus = new TTEventBus({ view_id: this.viewId });\n\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'status', 'user_status_id', this.user_api, function( res ) {\n\t\t\tres = res.getResult();\n\t\t\t$this.user_status_array = Global.buildRecordArray( res );\n\t\t} );\n\n\t\tthis.user_group_api.getUserGroup( '', false, false, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\n\t\t\t\tres = Global.buildTreeRecord( res );\n\t\t\t\t$this.user_group_array = res;\n\n\t\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['group_id'] ) {\n\t\t\t\t\t$this.basic_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t\t$this.adv_search_field_ui_dic['group_id'].setSourceData( res );\n\t\t\t\t}\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildEditViewUI() {\n\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_recurring_schedule': { 'label': $.i18n._( 'Recurring Schedule' ) },\n\t\t\t'tab_audit': true,\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tvar form_item_input;\n\t\tvar widgetContainer;\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIRecurringScheduleControl,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_recurring_schedule_control',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_recurring_schedule = this.edit_view_tab.find( '#tab_recurring_schedule' );\n\n\t\tvar tab_recurring_schedule_column1 = tab_recurring_schedule.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_recurring_schedule_column1 );\n\n\t\t// Template\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIRecurringScheduleTemplateControl,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_recurring_template_control',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'recurring_schedule_template_control_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Template' ), form_item_input, tab_recurring_schedule_column1, '' );\n\n\t\t// Start Week\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'start_week', width: 40 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Template Start Week' ), form_item_input, tab_recurring_schedule_column1 );\n\n\t\t// Start Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'start_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Start Date' ), form_item_input, tab_recurring_schedule_column1, '', null );\n\n\t\t// End Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\t\tform_item_input.TDatePicker( { field: 'end_date' } );\n\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\tvar label = $( '<span class=\\'widget-right-label\\'>' + $.i18n._( '(Leave blank for no end date)' ) + '</span>' );\n\n\t\twidgetContainer.append( form_item_input );\n\t\twidgetContainer.append( label );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'End Date' ), form_item_input, tab_recurring_schedule_column1, '', widgetContainer );\n\n\t\t// Display Weeks\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\tform_item_input.TTextInput( { field: 'display_weeks', width: 20 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Display Weeks' ), form_item_input, tab_recurring_schedule_column1, '', null );\n\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\t// Auto-Punch\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\tform_item_input.TCheckbox( { field: 'auto_fill' } );\n\t\t\twidgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\t\tlabel = $( '<span class=\\'widget-right-label t-checkbox-padding-left\\'> (' + $.i18n._( 'Punches employees in/out automatically' ) + ')</span>' );\n\t\t\twidgetContainer.append( form_item_input );\n\t\t\twidgetContainer.append( label );\n\t\t\tthis.addEditFieldToColumn( $.i18n._( 'Auto-Punch' ), form_item_input, tab_recurring_schedule_column1, '', widgetContainer );\n\t\t}\n\n\t\t// Employees\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tvar default_args = {};\n\t\tif ( ( Global.getProductEdition() >= 15 ) ) {\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tallow_multiple_selection: this.is_add === true,\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_any: true,\n\t\t\t\tfield: 'user_id',\n\t\t\t\tcustom_first_label: Global.empty_item,\n\t\t\t\taddition_source_function: function( target, source_data ) {\n\n\t\t\t\t\tif ( !source_data ) {\n\t\t\t\t\t\treturn source_data;\n\t\t\t\t\t}\n\n\t\t\t\t\tvar first_item = form_item_input.createItem( TTUUID.zero_id, Global.open_item );\n\t\t\t\t\tsource_data.unshift( first_item );\n\t\t\t\t\treturn source_data;\n\n\t\t\t\t},\n\t\t\t\tadded_items: [\n\t\t\t\t\t{ value: TTUUID.zero_id, label: Global.open_item }\n\t\t\t\t]\n\n\t\t\t} );\n\n\t\t\tdefault_args.permission_section = 'recurring_schedule';\n\t\t\tform_item_input.setDefaultArgs( default_args );\n\t\t} else {\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\tapi_class: TTAPI.APIUser,\n\t\t\t\tallow_multiple_selection: this.is_add === true,\n\t\t\t\tlayout_name: 'global_user',\n\t\t\t\tshow_search_inputs: true,\n\t\t\t\tset_any: true,\n\t\t\t\tcustom_first_label: Global.empty_item,\n\t\t\t\tfield: 'user_id'\n\t\t\t} );\n\t\t\tdefault_args.permission_section = 'recurring_schedule';\n\t\t\tform_item_input.setDefaultArgs( default_args );\n\t\t}\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employees' ), form_item_input, tab_recurring_schedule_column1, '', null, true );\n\t}\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Employee Status' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'user_status_id',\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Template' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'recurring_schedule_template_control_id',\n\t\t\t\tlayout_name: 'global_recurring_template_control',\n\t\t\t\tapi_class: TTAPI.APIRecurringScheduleTemplateControl,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( '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: true,\n\t\t\t\taddition_source_function: this.onEmployeeSourceCreate,\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._( 'Group' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tmultiple: true,\n\t\t\t\tfield: 'group_id',\n\t\t\t\tlayout_name: 'global_tree_column',\n\t\t\t\ttree_mode: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\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._( 'Title' ),\n\t\t\t\tfield: 'title_id',\n\t\t\t\tin_column: 1,\n\t\t\t\tlayout_name: 'global_job_title',\n\t\t\t\tapi_class: TTAPI.APIUserTitle,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\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._( 'Default Branch' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'default_branch_id',\n\t\t\t\tlayout_name: 'global_branch',\n\t\t\t\tapi_class: TTAPI.APIBranch,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tscript_name: 'BranchView',\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._( 'Default Department' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'default_department_id',\n\t\t\t\tlayout_name: 'global_department',\n\t\t\t\tapi_class: TTAPI.APIDepartment,\n\t\t\t\tmultiple: true,\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tscript_name: 'DepartmentView',\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: false,\n\t\t\t\tadv_search: true,\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: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} )\n\t\t];\n\t}\n\n\tonEmployeeSourceCreate( target, source_data ) {\n\n\t\tif ( Global.getProductEdition() <= 10 ) {\n\t\t\treturn source_data;\n\t\t}\n\n\t\tvar display_columns = target.getDisplayColumns();\n\t\tvar first_item = {};\n\t\t$.each( display_columns, function( index, content ) {\n\n\t\t\tfirst_item.id = TTUUID.zero_id;\n\t\t\tfirst_item[content.name] = Global.open_item;\n\n\t\t\treturn false;\n\t\t} );\n\n\t\t//Error: Object doesn't support property or method 'unshift' in /interface/html5/line 6953\n\t\tif ( !source_data || $.type( source_data ) !== 'array' ) {\n\t\t\tsource_data = [];\n\t\t}\n\t\tsource_data.unshift( first_item );\n\n\t\treturn source_data;\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: [],\n\t\t\tinclude: [\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._( 'Recurring Templates' ),\n\t\t\t\t\tid: 'recurring_template',\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},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Schedules' ),\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}\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'recurring_template':\n\t\t\tcase 'schedule':\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onNavigationClick( id );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\t/*\n \t* Common functions used by view and edit onclick logic\n \t*/\n\n\tonMassEditClick() {\n\n\t\tvar $this = this;\n\t\t$this.is_add = false;\n\t\t$this.is_viewing = false;\n\t\t$this.is_mass_editing = true;\n\t\tLocalCacheData.current_doing_context_action = 'mass_edit';\n\t\tvar filter = {};\n\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\tvar grid_selected_length = grid_selected_id_array.length;\n\t\tthis.mass_edit_record_ids = [];\n\n\t\t$.each( grid_selected_id_array, function( index, value ) {\n\t\t\t$this.mass_edit_record_ids.push( value );\n\t\t} );\n\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_data.id = this.mass_edit_record_ids;\n\n\t\tthis.api['getCommon' + this.api.key_name + 'Data']( filter, {\n\t\t\tonResult: function( result ) {\n\n\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\tif ( result_data.id ) {\n\t\t\t\t\t$this.onEditClick( result_data.id );\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.openEditView();\n\n\t\t\t\tif ( !result_data ) {\n\t\t\t\t\tresult_data = [];\n\t\t\t\t}\n\n\t\t\t\t$this.api['getOptions']( 'unique_columns', {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.unique_columns = result.getResult();\n\t\t\t\t\t\t$this.api['getOptions']( 'linked_columns', {\n\t\t\t\t\t\t\tonResult: function( result1 ) {\n\t\t\t\t\t\t\t\t$this.linked_columns = result1.getResult();\n\n\t\t\t\t\t\t\t\tif ( $this.sub_view_mode && $this.parent_key ) {\n\t\t\t\t\t\t\t\t\tresult_data[$this.parent_key] = $this.parent_value;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$this.current_edit_record = result_data;\n\t\t\t\t\t\t\t\t$this.initEditView();\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tonSaveResult( result ) {\n\t\tsuper.onSaveResult( result );\n\t\tif ( result && result.isValid() ) {\n\t\t\tvar system_job_queue = result.getAttributeInAPIDetails( 'system_job_queue' );\n\t\t\tif ( system_job_queue ) {\n\t\t\t\tthis.event_bus.emit( 'tt_topbar', 'toggle_job_queue_spinner', {\n\t\t\t\t\tshow: true,\n\t\t\t\t\tget_job_data: true\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\tonSaveClick( ignoreWarning ) {\n\t\tif ( !Global.isSet( ignoreWarning ) ) {\n\t\t\tignoreWarning = false;\n\t\t}\n\n\t\tvar record;\n\t\t//Setting is_add false too early can cause determineContextMenuMountAttributes() to have unexpected side effects. However not setting it here might have other side effects.\n\t\t//this.is_add = false;\n\t\tLocalCacheData.current_doing_context_action = 'save';\n\n\t\tif ( this.is_mass_editing ) {\n\t\t\tvar changed_fields = this.getChangedFields();\n\t\t\trecord = this.buildMassEditSaveRecord( this.mass_edit_record_ids, changed_fields );\n\n\t\t} else if ( this.is_mass_adding ) {\n\t\t\trecord = this.buildMassAddRecord( this.current_edit_record );\n\n\t\t} else {\n\t\t\trecord = this.getRecordsFromUserIDs();\n\t\t}\n\n\t\tthis.doSaveAPICall( record, ignoreWarning );\n\t}\n\n\tonSaveAndCopy( ignoreWarning ) {\n\t\tvar $this = this;\n\t\tif ( !Global.isSet( ignoreWarning ) ) {\n\t\t\tignoreWarning = false;\n\t\t}\n\t\tthis.is_add = true;\n\t\tthis.is_changed = false;\n\t\tLocalCacheData.current_doing_context_action = 'save_and_copy';\n\t\tvar record = this.getRecordsFromUserIDs();\n\n\t\tthis.clearNavigationData();\n\t\tthis.api['set' + this.api.key_name]( record, false, ignoreWarning, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.onSaveAndCopyResult( result );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tonSaveAndNewClick( ignoreWarning ) {\n\t\tvar $this = this;\n\t\tif ( !Global.isSet( ignoreWarning ) ) {\n\t\t\tignoreWarning = false;\n\t\t}\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\tvar record = this.getRecordsFromUserIDs();\n\t\tthis.api['set' + this.api.key_name]( record, false, ignoreWarning, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.onSaveAndNewResult( result );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tonSaveAndContinue( ignoreWarning ) {\n\t\tvar $this = this;\n\t\tif ( !Global.isSet( ignoreWarning ) ) {\n\t\t\tignoreWarning = false;\n\t\t}\n\t\tthis.is_changed = false;\n\t\tthis.is_add = false;\n\t\tLocalCacheData.current_doing_context_action = 'save_and_continue';\n\t\tvar record = this.getRecordsFromUserIDs();\n\n\t\tthis.doSaveAPICall( record, ignoreWarning, {\n\t\t\tonResult: function( result ) {\n\t\t\t\t$this.onSaveAndContinueResult( result );\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tvalidate( api ) {\n\t\tif ( this.enable_validation ) {\n\t\t\t//Allow alternate api to be validated.\n\t\t\tif ( api == undefined ) {\n\t\t\t\tvar api = this.api;\n\t\t\t}\n\n\t\t\tvar $this = this;\n\t\t\tvar record = {};\n\t\t\tif ( this.is_mass_editing ) {\n\t\t\t\tvar changed_fields = this.getChangedFields();\n\t\t\t\trecord = this.buildMassEditSaveRecord( this.mass_edit_record_ids, changed_fields );\n\t\t\t} else {\n\t\t\t\trecord = this.getRecordsFromUserIDs();\n\t\t\t}\n\t\t\tapi['validate' + api.key_name]( record, {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.validateResult( result );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tDebug.Text( 'Validation disabled', 'BaseViewController.js', 'BaseViewController', 'validate', 10 );\n\t\t}\n\t}\n\n\tgetRecordsFromUserIDs() {\n\t\tvar record;\n\t\tif ( Array.isArray( this.current_edit_record.user_id ) ) {\n\t\t\t//Convert multiple user_id recurring schedules to their own record for the API.\n\t\t\trecord = [];\n\t\t\tfor ( var i = 0; i < this.current_edit_record.user_id.length; i++ ) {\n\t\t\t\tvar tmp_record = Global.clone( this.current_edit_record );\n\t\t\t\ttmp_record.user_id = this.current_edit_record.user_id[i];\n\t\t\t\ttmp_record = this.uniformVariable( tmp_record );\n\t\t\t\trecord.push( tmp_record );\n\t\t\t}\n\t\t} else {\n\t\t\trecord = this.current_edit_record;\n\t\t\trecord = this.uniformVariable( record );\n\t\t}\n\t\treturn record;\n\t}\n\n\tonNavigationClick( iconName ) {\n\n\t\tvar $this = this;\n\t\tswitch ( iconName ) {\n\t\t\tcase 'schedule':\n\n\t\t\t\tvar filter = { filter_data: {} };\n\t\t\t\tvar selected_item = this.getSelectedItem();\n\t\t\t\tvar include_users = null;\n\t\t\t\tvar now_date = new Date();\n\n\t\t\t\tif ( !Global.isSet( selected_item.user_id ) ) {\n\n\t\t\t\t\tvar temp_filter = {};\n\t\t\t\t\ttemp_filter.filter_data = {};\n\t\t\t\t\ttemp_filter.filter_data.id = [selected_item.id];\n\t\t\t\t\ttemp_filter.filter_columns = { user_id: true };\n\n\t\t\t\t\tthis.api['get' + this.api.key_name]( temp_filter, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresult_data = result_data[0];\n\n\t\t\t\t\t\t\tinclude_users = [result_data.user_id];\n\n\t\t\t\t\t\t\tfilter.filter_data.include_user_ids = { value: include_users };\n\t\t\t\t\t\t\tfilter.select_date = now_date.format();\n\t\t\t\t\t\t\tGlobal.addViewTab( $this.viewId, $.i18n._( 'Recurring Schedules' ), window.location.href );\n\t\t\t\t\t\t\tIndexViewController.goToView( 'Schedule', filter );\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\t\t\t\t\tinclude_users = [selected_item.user_id];\n\t\t\t\t\tfilter.filter_data.include_user_ids = { value: include_users };\n\t\t\t\t\tfilter.select_date = now_date.format();\n\n\t\t\t\t\tGlobal.addViewTab( this.viewId, $.i18n._( 'Recurring Schedules' ), window.location.href );\n\t\t\t\t\tIndexViewController.goToView( 'Schedule', filter );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'recurring_template':\n\n\t\t\t\tfilter = { filter_data: {} };\n\t\t\t\tselected_item = this.getSelectedItem();\n\n\t\t\t\tif ( !Global.isSet( selected_item.recurring_schedule_template_control_id ) ) {\n\n\t\t\t\t\ttemp_filter = {};\n\t\t\t\t\ttemp_filter.filter_data = {};\n\t\t\t\t\ttemp_filter.filter_data.id = [selected_item.id];\n\n\t\t\t\t\tthis.api['get' + this.api.key_name]( temp_filter, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t\tvar result_data = result.getResult();\n\n\t\t\t\t\t\t\tif ( !result_data ) {\n\t\t\t\t\t\t\t\tresult_data = [];\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tresult_data = result_data[0];\n\n\t\t\t\t\t\t\tfilter.filter_data.id = [result_data.recurring_schedule_template_control_id];\n\n\t\t\t\t\t\t\tGlobal.addViewTab( $this.viewId, $.i18n._( 'Recurring Schedules' ), window.location.href );\n\t\t\t\t\t\t\tIndexViewController.goToView( 'RecurringScheduleTemplateControl', filter );\n\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t} else {\n\t\t\t\t\tfilter.filter_data.id = [selected_item.recurring_schedule_template_control_id];\n\n\t\t\t\t\tGlobal.addViewTab( this.viewId, $.i18n._( 'Recurring Schedules' ), window.location.href );\n\t\t\t\t\tIndexViewController.goToView( 'RecurringScheduleTemplateControl', filter );\n\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t\tcase 'export_excel':\n\t\t\t\tthis.onExportClick( 'exportRecurringScheduleControl' );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'recurring_template':\n\t\t\t\tthis.setDefaultMenuRecurringTemplateIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tthis.setDefaultMenuScheduleIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetDefaultMenuRecurringTemplateIcon( context_btn, grid_selected_length, pId ) {\n\t\tif ( !this.viewPermissionValidate( pId ) || 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\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\tsearch( set_default_menu, page_action, page_number, callBack ) {\n\n\t\tif ( !Global.isSet( set_default_menu ) ) {\n\t\t\tset_default_menu = true;\n\t\t}\n\n\t\tvar $this = this;\n\t\tvar filter = {};\n\t\tfilter.filter_data = {};\n\t\tfilter.filter_sort = {};\n\t\tfilter.filter_columns = this.getFilterColumnsFromDisplayColumns();\n\t\tfilter.filter_items_per_page = 0; // Default to 0 to load user preference defined\n\n\t\tif ( this.pager_data ) {\n\n\t\t\tif ( LocalCacheData.paging_type === 0 ) {\n\t\t\t\tif ( page_action === 'next' ) {\n\t\t\t\t\tfilter.filter_page = this.pager_data.next_page;\n\t\t\t\t} else {\n\t\t\t\t\tfilter.filter_page = 1;\n\t\t\t\t}\n\t\t\t} else {\n\n\t\t\t\tswitch ( page_action ) {\n\t\t\t\t\tcase 'next':\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.next_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'last':\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.previous_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'start':\n\t\t\t\t\t\tfilter.filter_page = 1;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'end':\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.last_page_number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'go_to':\n\t\t\t\t\t\tfilter.filter_page = page_number;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tfilter.filter_page = this.pager_data.current_page;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t} else {\n\t\t\tfilter.filter_page = 1;\n\t\t}\n\n\t\tif ( this.sub_view_mode && this.parent_key ) {\n\t\t\tthis.select_layout.data.filter_data[this.parent_key] = this.parent_value;\n\t\t}\n\t\t//If sub view controller set custom filters, get it\n\t\tif ( Global.isSet( this.getSubViewFilter ) ) {\n\n\t\t\tthis.select_layout.data.filter_data = this.getSubViewFilter( this.select_layout.data.filter_data );\n\n\t\t}\n\n\t\t//select_layout will not be null, it's set in setSelectLayout function\n\t\tfilter.filter_data = Global.convertLayoutFilterToAPIFilter( this.select_layout );\n\t\tfilter.filter_sort = this.select_layout.data.filter_sort;\n\n\t\tthis.last_select_ids = this.getGridSelectIdArray();\n\n\t\tthis.api['get' + this.api.key_name]( filter, {\n\t\t\tonResult: function( result ) {\n\n\t\t\t\tvar result_data = result.getResult();\n\t\t\t\tif ( !Global.isArray( result_data ) ) {\n\t\t\t\t\t$this.showNoResultCover();\n\t\t\t\t} else {\n\t\t\t\t\t$this.removeNoResultCover();\n\t\t\t\t\tif ( Global.isSet( $this.__createRowId ) ) {\n\t\t\t\t\t\tresult_data = $this.__createRowId( result_data );\n\t\t\t\t\t}\n\n\t\t\t\t\tresult_data = Global.formatGridData( result_data, $this.api.key_name );\n\t\t\t\t}\n\t\t\t\t//Set Page data to widget, next show display info when setDefault Menu\n\t\t\t\t$this.pager_data = result.getPagerData();\n\n\t\t\t\t//CLick to show more mode no need this step\n\t\t\t\tif ( LocalCacheData.paging_type !== 0 ) {\n\t\t\t\t\t$this.paging_widget.setPagerData( $this.pager_data );\n\t\t\t\t\t$this.paging_widget_2.setPagerData( $this.pager_data );\n\t\t\t\t}\n\n\t\t\t\tif ( LocalCacheData.paging_type === 0 && page_action === 'next' ) {\n\t\t\t\t\tvar current_data = $this.grid.getGridParam( 'data' );\n\t\t\t\t\tresult_data = current_data.concat( result_data );\n\t\t\t\t}\n\n\t\t\t\t///Override to reset id, because id of each record is the same if employess assigned to this id.\n\t\t\t\tvar len = result_data.length;\n\n\t\t\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\t\t\tvar item = result_data[i];\n\t\t\t\t}\n\n\t\t\t\tif ( $this.grid ) {\n\t\t\t\t\t$this.grid.setData( result_data );\n\n\t\t\t\t\t$this.reSelectLastSelectItems();\n\t\t\t\t}\n\n\t\t\t\t$this.setGridCellBackGround(); //Set cell background for some views\n\n\t\t\t\tProgressBar.closeOverlay(); //Add this in initData\n\t\t\t\tif ( set_default_menu ) {\n\t\t\t\t\t$this.setDefaultMenu( true );\n\t\t\t\t}\n\n\t\t\t\tif ( LocalCacheData.paging_type === 0 ) {\n\t\t\t\t\tif ( !$this.pager_data || $this.pager_data.is_last_page ) {\n\t\t\t\t\t\t$this.paging_widget.css( 'display', 'none' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this.paging_widget.css( 'display', 'block' );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif ( callBack ) {\n\t\t\t\t\tcallBack( result );\n\t\t\t\t}\n\n\t\t\t\t// when call this from save and new result, we don't call auto open, because this will call onAddClick twice\n\t\t\t\tif ( set_default_menu ) {\n\t\t\t\t\t$this.autoOpenEditViewIfNecessary();\n\t\t\t\t}\n\n\t\t\t\t$this.searchDone();\n\t\t\t}\n\t\t} );\n\t}\n\n\tgetFilterColumnsFromDisplayColumns() {\n\t\tvar column_filter = {};\n\t\tcolumn_filter.user_id = true;\n\n\t\treturn this._getFilterColumnsFromDisplayColumns( column_filter, true );\n\t}\n\n\tsetCustomEditMenuIcon( id, context_btn ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'recurring_template':\n\t\t\t\tthis.setEditMenuRecurringTemplateIcon( context_btn );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tthis.setEditMenuScheduleIcon( context_btn );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetEditMenuRecurringTemplateIcon( context_btn, pId ) {\n\t\tif ( !this.viewPermissionValidate( pId ) || this.edit_only_mode ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\tsetEditMenuScheduleIcon( context_btn, pId ) {\n\t\tif ( !this.viewPermissionValidate( pId ) || this.edit_only_mode ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\n\t}\n}\n//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiODY5LmpzIiwibWFwcGluZ3MiOiI7Ozs7OztBQUFPO0FBQ1AsMkJBQTJCO0FBQzNCLEVBQUUsQ0FBQztBQUNIOzs7QUFHQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsMkJBQTJCLENBQUM7QUFDNUIsMEJBQTBCLENBQUM7QUFDM0I7QUFDQTtBQUNBO0FBQ0Esb0NBQW9DLHNCQUFzQjs7QUFFMUQ7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjtBQUNBO0FBQ0E7O0FBRUE7QUFDQTs7QUFFQTtBQUNBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLElBQUk7QUFDSjs7QUFFQTs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBLCtCQUErQixTQUFTLENBQUMsaUNBQWlDO0FBQzFFO0FBQ0E7QUFDQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTs7QUFFSjs7QUFFQTs7QUFFQTs7QUFFQTs7QUFFQTs7QUFFQTs7QUFFQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0EsSUFBSTtBQUNKLDZCQUE2QixDQUFDOztBQUU5QjtBQUNBO0FBQ0EsZ0NBQWdDLGlDQUFpQ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