TimeTrex/interface/html5/dist/policy-accrual_policy-AccrualPolicyViewController.bundle.js

1 line
114 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["policy-accrual_policy-AccrualPolicyViewController"],{5594:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"AccrualPolicyViewController\": () => (/* binding */ AccrualPolicyViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass AccrualPolicyViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#accrual_policy_view_container',\n\n\t\t\ttype_array: null,\n\t\t\tapply_frequency_array: null,\n\t\t\tmonth_of_year_array: null,\n\t\t\tday_of_month_array: null,\n\t\t\tday_of_week_array: null,\n\t\t\tmonth_of_quarter_array: null,\n\t\t\tlength_of_service_unit_array: null,\n\t\t\toriginal_milestone_data: [],\n\t\t\tdate_api: null,\n\t\t\taccrual_policy_milestone_api: null,\n\t\t\taccrual_policy_user_modifier_api: null,\n\n\t\t\tsub_accrual_policy_user_modifier_view_controller: 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 = 'AccrualPolicyEditView.html';\n\t\tthis.permission_id = 'accrual_policy';\n\t\tthis.viewId = 'AccrualPolicy';\n\t\tthis.script_name = 'AccrualPolicyView';\n\t\tthis.table_name_key = 'accrual_policy';\n\t\tthis.context_menu_name = $.i18n._( 'Accrual Policy' );\n\t\tthis.navigation_label = $.i18n._( 'Accrual Policy' );\n\t\tthis.api = TTAPI.APIAccrualPolicy;\n\t\tthis.date_api = TTAPI.APITTDate;\n\t\tthis.accrual_policy_milestone_api = TTAPI.APIAccrualPolicyMilestone;\n\t\tthis.accrual_policy_user_modifier_api = TTAPI.APIAccrualPolicyUserModifier;\n\t\tthis.month_of_quarter_array = Global.buildRecordArray( { 1: 1, 2: 2, 3: 3 } );\n\t\tthis.render();\n\t\tthis.buildContextMenu();\n\n\t\tthis.initData();\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 're_calculate_accrual':\n\t\t\t\tthis.onReCalAccrualClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonReCalAccrualClick() {\n\t\tvar default_data = {};\n\t\tvar $this = this;\n\n\t\tif ( this.edit_view ) {\n\t\t\tdefault_data.accrual_policy_id = [this.current_edit_record.id];\n\t\t} else {\n\t\t\tdefault_data.accrual_policy_id = this.getGridSelectIdArray();\n\t\t}\n\n\t\tIndexViewController.openWizard( 'ReCalculateAccrualWizard', default_data, function() {\n\t\t\t$this.search();\n\t\t} );\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: '', //Empty label. vue_icon is displayed instead of text.\n\t\t\t\t\tid: 'other_header',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other',\n\t\t\t\t\taction_group_header: true,\n\t\t\t\t\tvue_icon: 'tticon tticon-more_vert_black_24dp',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'ReCalculate Accrual' ),\n\t\t\t\t\tid: 're_calculate_accrual',\n\t\t\t\t\tpermission_result: true,\n\t\t\t\t\tpermission: null,\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\taction_group: 'other'\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tvar options = [\n\t\t\t{ option_name: 'type', api: this.api },\n\t\t\t{ option_name: 'apply_frequency', api: this.api },\n\t\t\t{ option_name: 'length_of_service_unit', field_name: 'length_of_service_unit_id', api: this.accrual_policy_milestone_api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.date_api.getMonthOfYearArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.month_of_year_array = res;\n\t\t\t}\n\t\t} );\n\t\tthis.date_api.getDayOfMonthArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = res.getResult();\n\t\t\t\t$this.day_of_month_array = res;\n\t\t\t}\n\t\t} );\n\t\tthis.date_api.getDayOfWeekArray( {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres =