TimeTrex/interface/html5/dist/attendance-accrual_balance-AccrualBalanceViewController.bundle.js

1 line
39 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-accrual_balance-AccrualBalanceViewController"],{8726:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AccrualBalanceViewController\": () => (/* binding */ AccrualBalanceViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass AccrualBalanceViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#accrual_balance_view_container',\n\n\t\t\tuser_group_api: null,\n\t\t\tuser_group_array: null,\n\n\t\t\tsub_accrual_view_controller: null,\n\n\t\t\tlog_object_ids: 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 = 'AccrualBalanceEditView.html';\n\t\tthis.permission_id = 'accrual';\n\t\tthis.viewId = 'AccrualBalance';\n\t\tthis.script_name = 'AccrualBalanceView';\n\t\tthis.table_name_key = 'accrual';\n\t\tthis.context_menu_name = $.i18n._( 'Accrual Balances' );\n\t\tthis.navigation_label = $.i18n._( 'Accrual Balance' );\n\t\tthis.api = TTAPI.APIAccrualBalance;\n\t\tthis.accrual_api = TTAPI.APIAccrual;\n\t\tthis.user_api = TTAPI.APIUser;\n\t\tthis.user_group_api = TTAPI.APIUserGroup;\n\n\t\tthis.initPermission();\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\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.show_search_tab = true;\n\t\t} else {\n\t\t\tthis.show_search_tab = false;\n\t\t}\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'status', 'user_status_id', this.user_api, null, 'user_status_array' );\n\t\tthis.user_group_api.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': {\n\t\t\t\t'label': $.i18n._( 'Accrual' ),\n\t\t\t\t'init_callback': 'initSubAccrualView',\n\t\t\t\t'display_on_mass_edit': false\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.APIAccrualBalance,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_accrual_balance',\n\t\t\tnavigation_mode: true,\n\t\t\taddition_source_function: function( target, data ) {\n\t\t\t\treturn $this.__createRowId( data );\n\t\t\t},\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\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'add',\n\t\t\t\t'view',\n\t\t\t\t'export_excel'\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tbuildSearchFields() {\n\t\tsuper.buildSearchFields();\n\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'accrual';\n\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\tdefault_args: default_args,\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._( 'Employee Status' ),\n\t\t\t\tin_c