TimeTrex/interface/html5/dist/hr-kpi-UserReviewControlViewController.bundle.js

1 line
96 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["hr-kpi-UserReviewControlViewController"],{7454:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserReviewControlViewController\": () => (/* binding */ UserReviewControlViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass UserReviewControlViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_review_control_view_container',\n\n\n\n\t\t\ttype_array: null,\n\t\t\tstatus_array: null,\n\t\t\tterm_array: null,\n\t\t\tseverity_array: null,\n\n\t\t\tkpi_group_array: null,\n\t\t\toriginal_user_review_data: [],\n\n\t\t\tdocument_object_type_id: null,\n\n\t\t\tkpi_group_api: null,\n\n\t\t\tuser_review_api: null,\n\n\t\t\tkpi_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 = 'UserReviewControlEditView.html';\n\t\tthis.permission_id = 'user_review';\n\t\tthis.viewId = 'UserReviewControl';\n\t\tthis.script_name = 'UserReviewControlView';\n\t\tthis.table_name_key = 'user_review_control';\n\t\tthis.context_menu_name = $.i18n._( 'Reviews' );\n\t\tthis.navigation_label = $.i18n._( 'Review' );\n\t\tthis.api = TTAPI.APIUserReviewControl;\n\t\tthis.kpi_group_api = TTAPI.APIKPIGroup;\n\t\tthis.user_review_api = TTAPI.APIUserReview;\n\t\tthis.kpi_api = TTAPI.APIKPI;\n\t\tthis.document_object_type_id = 220;\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}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['mass_edit'],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Print' ),\n\t\t\t\t\tid: 'pdf_review_print',\n\t\t\t\t\tvue_icon: 'tticon tticon-print_black_24dp',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\tsort_order: 100\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: 'status', api: this.api },\n\t\t\t{ option_name: 'term', api: this.api },\n\t\t\t{ option_name: 'severity', api: this.api },\n\t\t];\n\n\t\tthis.initDropDownOptions( options );\n\n\t\tthis.kpi_group_api.getKPIGroup( false, false, false, {\n\t\t\tonResult: function( res ) {\n\t\t\t\tres = Global.clone( res.getResult() );\n\n\t\t\t\t//Error: Uncaught TypeError: Cannot set property 'name' of undefined in /interface/html5/#!m=Employee&a=edit&id=41499&tab=Reviews line 60\n\t\t\t\tif ( !res || !res[0] ) {\n\t\t\t\t\t$this.kpi_group_array = [];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tres[0].name = '-- ' + $.i18n._( 'Add KPIs' ) + ' --';\n\n\t\t\t\tvar all = {};\n\t\t\t\tall.name = '-- ' + $.i18n._( 'All' ) + ' --';\n\t\t\t\tall.level = 1;\n\t\t\t\tall.id = TTUUID.not_exist_id;\n\n\t\t\t\tif ( res.hasOwnProperty( '0' ) && res[0].hasOwnProperty( 'children' ) ) {\n\t\t\t\t\tres[0].children.unshift( all );\n\t\t\t\t} else {\n\t\t\t\t\tres = [\n\t\t\t\t\t\t{ children: [all], id: 0, level: 0, name: '-- ' + $.i18n._( 'Add KPIs' ) + ' --' }\n\t\t\t\t\t];\n\t\t\t\t}\n\n\t\t\t\tres = Global.buildTreeRecord( res );\n\n\t\t\t\t$this.kpi_group_array = res;\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_review': {\n\t\t\t\t'label': $.i18n._( 'Review' ),\n\t\t\t\t'html_template': this.getUserReviewTabHtml(),\n\t\t\t\t'is_multi_column': true\n\t\t\t},\n\t\t\t'tab_attachment': true,\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\tap