TimeTrex/interface/html5/dist/attendance-accrual-AccrualViewController.bundle.js

1 line
72 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-accrual-AccrualViewController"],{1629:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AccrualViewController\": () => (/* binding */ AccrualViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass AccrualViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#accrual_view_container',\n\t\t\ttype_array: null,\n\n\t\t\tuser_group_api: null,\n\t\t\tuser_group_array: null,\n\t\t\tuser_type_array: null,\n\t\t\tsystem_type_array: null,\n\t\t\tdelete_type_array: null,\n\t\t\tdate_api: null,\n\n\t\t\tedit_enabled: false,\n\t\t\tdelete_enabled: false,\n\n\t\t\tis_trigger_add: false,\n\n\t\t\tsub_view_grid_data: null,\n\n\t\t\thide_search_field: false,\n\n\t\t\tapi_accrual_balance: null,\n\n//\t parent_filter: null,\n\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 = 'AccrualEditView.html';\n\t\tthis.permission_id = 'accrual';\n\t\tthis.viewId = 'Accrual';\n\t\tthis.script_name = 'AccrualView';\n\t\tthis.table_name_key = 'accrual';\n\t\tthis.context_menu_name = $.i18n._( 'Accruals' );\n\t\tthis.navigation_label = $.i18n._( 'Accrual' );\n\n\t\tthis.api = TTAPI.APIAccrual;\n\t\tthis.api_accrual_balance = TTAPI.APIAccrualBalance;\n\n\t\tthis.initPermission();\n\t\tthis.render();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t}\n\n\t\t//call init data in parent view\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tthis.initData();\n\t\t}\n\t\tTTPromise.resolve( 'AccrualViewController', 'init' );\n\t}\n\n\tinitPermission() {\n\n\t\tsuper.initPermission();\n\n\t\tif ( PermissionManager.validate( this.permission_id, 'view' ) || PermissionManager.validate( this.permission_id, 'view_child' ) ) {\n\t\t\tthis.hide_search_field = false;\n\t\t} else {\n\t\t\tthis.hide_search_field = true;\n\t\t}\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'user_type', null, null, function( res ) {\n\t\t\tvar result = res.getResult();\n\t\t\t$this.user_type_array = result;\n\n\t\t} );\n\t\tthis.initDropDownOption( 'delete_type', null, null, function( res ) {\n\t\t\tvar result = res.getResult();\n\t\t\t$this.delete_type_array = result;\n\n\t\t} );\n\n\t\tthis.initDropDownOption( 'type', null, null, function( res ) {\n\t\t\tvar result = res.getResult();\n\t\t\t$this.system_type_array = result;\n\t\t\tif ( !$this.sub_view_mode && $this.basic_search_field_ui_dic['type_id'] ) {\n\t\t\t\t$this.basic_search_field_ui_dic['type_id'].setSourceData( Global.buildRecordArray( result ) );\n\t\t\t}\n\t\t} );\n\n\t\tTTAPI.APIUserGroup.getUserGroup( '', false, false, {\n\t\t\tonResult: function( res ) {\n\n\t\t\t\tres = res.getResult();\n\t\t\t\tres = Global.buildTreeRecord( 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}\n\n\t\t\t\t$this.user_group_array = res;\n\n\t\t\t}\n\t\t} );\n\t}\n\n\tbuildEditViewUI() {\n\t\tsuper.buildEditViewUI();\n\n\t\tvar $this = this;\n\n\t\tvar tab_model = {\n\t\t\t'tab_accrual': { 'label': $.i18n._( 'Accrual' ) },\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.APIAccrual,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_accrual_accrual',\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_accrual = this.edit_view_tab.find( '#tab_accrual' );\n\n\t\tvar tab_accrual_column1 = ta