1 line
96 KiB
JavaScript
1 line
96 KiB
JavaScript
"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\tapi_class: TTAPI.APIUserReviewControl,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_kpi_review_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_review = this.edit_view_tab.find( '#tab_review' );\n\n\t\tvar tab_review_column1 = tab_review.find( '.first-column' );\n\t\tvar tab_review_column2 = tab_review.find( '.second-column' );\n\t\tvar tab_review_column4 = tab_review.find( '.forth-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_review_column1 );\n\t\tthis.edit_view_tabs[0].push( tab_review_column2 );\n\n\t\t// Employee\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'user_id'\n\t\t} );\n\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'user_review';\n\t\tform_item_input.setDefaultArgs( default_args );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Employee' ), form_item_input, tab_review_column1, '' );\n\n\t\t// Reviewer\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\t\tform_item_input.AComboBox( {\n\t\t\tapi_class: TTAPI.APIUser,\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_user',\n\t\t\tshow_search_inputs: true,\n\t\t\tset_empty: true,\n\t\t\tfield: 'reviewer_user_id'\n\t\t} );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Reviewer' ), form_item_input, tab_review_column1 );\n\n\t\t// Status\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'status_id' } );\n\t\tform_item_input.setSourceData( $this.status_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Status' ), form_item_input, tab_review_column1 );\n\n\t\t// Type\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'type_id' } );\n\t\tform_item_input.setSourceData( $this.type_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Type' ), form_item_input, tab_review_column1 );\n\n\t\t// Terms\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'term_id' } );\n\t\tform_item_input.setSourceData( $this.term_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Terms' ), form_item_input, tab_review_column1 );\n\n\t\t// Rating\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'rating', width: 50 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Rating' ), form_item_input, tab_review_column1, '' );\n\n\t\t// Severity\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.COMBO_BOX );\n\n\t\tform_item_input.TComboBox( { field: 'severity_id' } );\n\t\tform_item_input.setSourceData( $this.severity_array );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Severity' ), form_item_input, tab_review_column2, '' );\n\n\t\t// Start Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'start_date' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Start Date' ), form_item_input, tab_review_column2, '', null );\n\n\t\t// End Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'end_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'End Date' ), form_item_input, tab_review_column2, '', null );\n\n\t\t// Due Date\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.DATE_PICKER );\n\n\t\tform_item_input.TDatePicker( { field: 'due_date' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Due Date' ), form_item_input, tab_review_column2, '', null );\n\n\t\t//Tags\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TAG_INPUT );\n\n\t\tform_item_input.TTagInput( { field: 'tag', object_type_id: 320 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Tags' ), form_item_input, tab_review_column2, '', null, null, true );\n\n\t\tif ( this.is_add || this.is_edit ) {\n\t\t\t// Add KPIs from Groups\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.AWESOME_BOX );\n\n\t\t\tform_item_input.AComboBox( {\n\t\t\t\ttree_mode: true,\n\t\t\t\tallow_multiple_selection: false,\n\t\t\t\tlayout_name: 'global_tree_column',\n\t\t\t\tset_empty: true,\n\t\t\t\tfield: 'group_id'\n\t\t\t} );\n\t\t\tform_item_input.setSourceData( $this.kpi_group_array );\n\n\t\t\tvar tab_review_column3 = tab_review.find( '.third-column' ).css( {\n\t\t\t\t'float': 'left',\n\t\t\t\t'margin-top': '10px',\n\t\t\t\t'margin-bottom': '10px'\n\t\t\t} );\n\t\t\ttab_review_column3.find( '.column-form-item-label' ).css( {\n\t\t\t\t'float': 'left',\n\t\t\t\t'margin-right': '10px',\n\t\t\t\t'margin-top': '5px'\n\t\t\t} ).text( $.i18n._( 'Add KPIs from Groups' ) );\n\t\t\ttab_review_column3.find( '.column-form-item-input' ).css( { 'float': 'left' } ).append( form_item_input );\n\n\t\t\tthis.edit_view_ui_dic[form_item_input.getField()] = form_item_input;\n\n\t\t\tform_item_input.bind( 'formItemChange', function( e, target, doNotValidate ) {\n\t\t\t\t$this.onFormItemChange( target, doNotValidate );\n\t\t\t} );\n\t\t}\n\n\t\t// Note\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\n\t\tform_item_input.TTextArea( { field: 'note', width: '100%', height: 66 } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Note' ), form_item_input, tab_review_column4, 'first_last', null, null, true );\n\t}\n\n\tinitInsideEditorUI() {\n\t\t//Inside editor\n\t\tvar tab_review = this.edit_view_tab.find( '#tab_review' );\n\n\t\tvar inside_editor_div = tab_review.find( '.inside-editor-div' );\n\n\t\tvar args = {\n\t\t\tserial: '#',\n\t\t\tname: $.i18n._( 'Key Performance Indicator' ) + '<br>(' + $.i18n._('Hover for Description') + ')',\n\t\t\trating: $.i18n._( 'Result' ),\n\t\t\tnote: $.i18n._( 'Note' )\n\t\t};\n\n\t\tthis.editor = Global.loadWidgetByName( FormItemType.INSIDE_EDITOR );\n\n\t\tthis.editor.InsideEditor( {\n\t\t\taddRow: this.insideEditorAddRow,\n\t\t\tremoveRow: this.insideEditorRemoveRow,\n\t\t\tgetValue: this.insideEditorGetValue,\n\t\t\tsetValue: this.insideEditorSetValue,\n\t\t\tonFormItemChange: this.onInsideFormItemChange,\n\t\t\tparent_controller: this,\n\t\t\tapi: this.user_review_api,\n\t\t\trender: getRender(),\n\t\t\trender_args: args,\n\t\t\trender_inline_html: true,\n\t\t\trow_render: getRowRender()\n\n\t\t} );\n\n\t\tfunction getRender() {\n\t\t\treturn `\n\t\t\t<table class=\"inside-editor-render\">\n\t\t\t\t<tr class=\"title\" style=\"font-weight: bold\">\n\t\t\t\t\t<td style=\"width: 50px\"><%= serial %></td>\n\t\t\t\t\t<td style=\"width: 820px\"><%= name %></td>\n\t\t\t\t\t<td style=\"width: 70px\"><%= rating %></td>\n\t\t\t\t\t<td style=\"width: 300px;\"><%= note %></td>\n\t\t\t\t</tr>\n\t\t\t</table>`;\n\t\t}\n\n\t\tfunction getRowRender() {\n\t\t\treturn `\n\t\t\t<tr class=\"inside-editor-row data-row\">\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t\t<td></td>\n\t\t\t</tr>`;\n\t\t}\n\n\t\tinside_editor_div.append( this.editor );\n\t}\n\n\t/* jshint ignore:start */\n\n\taddEditFieldToColumn( label, widgets, column, firstOrLastRecord, widgetContainer, saveFormItemDiv, setResizeEvent, saveFormItemDivKey, hasKeyEvent, customLabelWidget ) {\n\n\t\tvar $this = this;\n\t\tvar form_item = $( Global.loadWidgetByName( WidgetNamesDic.EDIT_VIEW_FORM_ITEM ) );\n\t\tvar form_item_label_div = form_item.find( '.edit-view-form-item-label-div' );\n\t\tvar form_item_label = form_item.find( '.edit-view-form-item-label' );\n\t\tvar form_item_input_div = form_item.find( '.edit-view-form-item-input-div' );\n\n\t\tif ( customLabelWidget ) {\n\t\t\tform_item_label.parent().append( customLabelWidget );\n\t\t\tform_item_label.remove();\n\t\t} else {\n\t\t\tform_item_label.text( $.i18n._( label ) );\n\t\t}\n\n\t\tvar widget = widgets;\n\n\t\tif ( Global.isArray( widgets ) ) {\n\n\t\t\tfor ( var i = 0; i < widgets.length; i++ ) {\n\t\t\t\twidget = widgets[i];\n\t\t\t\twidget.css( 'opacity', 0 );\n\n\t\t\t\tthis.edit_view_ui_dic[widget.getField()] = widget;\n\n\t\t\t\twidget.unbind( 'formItemChange' ).bind( 'formItemChange', function( e, target, doNotValidate ) {\n\t\t\t\t\t$this.onFormItemChange( target, doNotValidate );\n\t\t\t\t} );\n\n\t\t\t\tif ( hasKeyEvent ) {\n\t\t\t\t\twidget.unbind( 'formItemKeyUp' ).bind( 'formItemKeyUp', function( e, target ) {\n\t\t\t\t\t\t$this.onFormItemKeyUp( target );\n\t\t\t\t\t} );\n\n\t\t\t\t\twidget.unbind( 'formItemKeyDown' ).bind( 'formItemKeyDown', function( e, target ) {\n\t\t\t\t\t\t$this.onFormItemKeyDown( target );\n\t\t\t\t\t} );\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\n\t\t\twidget.css( 'opacity', 0 );\n\n\t\t\tthis.edit_view_ui_dic[widget.getField()] = widget;\n\n\t\t\twidget.bind( 'formItemChange', function( e, target, doNotValidate ) {\n\t\t\t\t$this.onFormItemChange( target, doNotValidate );\n\t\t\t} );\n\n\t\t\tif ( hasKeyEvent ) {\n\t\t\t\twidget.bind( 'formItemKeyUp', function( e, target ) {\n\t\t\t\t\t$this.onFormItemKeyUp( target );\n\t\t\t\t} );\n\n\t\t\t\twidget.bind( 'formItemKeyDown', function( e, target ) {\n\t\t\t\t\t$this.onFormItemKeyDown( target );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t}\n\n\t\tif ( Global.isSet( widgetContainer ) ) {\n\t\t\tform_item_input_div.append( widgetContainer );\n\n\t\t} else {\n\t\t\tform_item_input_div.append( widget );\n\t\t}\n\n\t\tif ( setResizeEvent ) {\n\n\t\t\tif ( widget.getField() === 'note' ) {\n\n\t\t\t\tform_item_input_div.css( 'width', '80%' );\n\t\t\t\tform_item_label_div.css( 'height', '80' );\n\t\t\t\twidget.css( { 'width': '100%', 'resize': 'none' } );\n\n\t\t\t} else {\n\n\t\t\t\tform_item.bind( 'resize', function() {\n\n\t\t\t\t\tif ( form_item_label_div.height() !== form_item.height() && form_item.height() !== 0 ) {\n\t\t\t\t\t\tform_item_label_div.css( 'height', form_item.height() );\n\t\t\t\t\t\tform_item.unbind( 'resize' );\n\t\t\t\t\t}\n\n\t\t\t\t} );\n\n\t\t\t\twidget.bind( 'setSize', function() {\n\t\t\t\t\tform_item_label_div.css( 'height', widget.height() + 5 );\n\t\t\t\t} );\n\t\t\t}\n\n\t\t}\n\n\t\tif ( saveFormItemDiv ) {\n\n\t\t\tif ( Global.isArray( widgets ) ) {\n\t\t\t\tthis.edit_view_form_item_dic[widgets[0].getField()] = form_item;\n\t\t\t} else {\n\t\t\t\tthis.edit_view_form_item_dic[widget.getField()] = form_item;\n\t\t\t}\n\n\t\t}\n\n\t\tcolumn.append( form_item );\n\t\t//column.append( \"<div class='clear-both-div'></div>\" );\n\t}\n\n\t/* jshint ignore:end */\n\n\tbuildSearchFields() {\n\n\t\tsuper.buildSearchFields();\n\n\t\tvar default_args = {};\n\t\tdefault_args.permission_section = 'user_review';\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\tfield: 'user_id',\n\t\t\t\tdefault_args: default_args,\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\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Reviewer' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'reviewer_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\tform_item_type: FormItemType.AWESOME_BOX\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Type' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'type_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._( 'Tags' ),\n\t\t\t\tfield: 'tag',\n\t\t\t\tbasic_search: true,\n\t\t\t\tadv_search: true,\n\t\t\t\tin_column: 1,\n\t\t\t\tobject_type_id: 320,\n\t\t\t\tform_item_type: FormItemType.TAG_INPUT\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Status' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: '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._( 'Terms' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'term_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._( 'Severity' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'severity_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._( 'Start Date' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'start_date',\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.DATE_PICKER\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'End Date' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'end_date',\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.DATE_PICKER\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'Due Date' ),\n\t\t\t\tin_column: 1,\n\t\t\t\tfield: 'due_date',\n\t\t\t\tbasic_search: false,\n\t\t\t\tadv_search: true,\n\t\t\t\tform_item_type: FormItemType.DATE_PICKER\n\t\t\t} ),\n\n\t\t\tnew SearchField( {\n\t\t\t\tlabel: $.i18n._( 'KPI' ),\n\t\t\t\tin_column: 2,\n\t\t\t\tfield: 'kpi_id',\n\t\t\t\tlayout_name: 'global_kpi',\n\t\t\t\tapi_class: TTAPI.APIKPI,\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._( '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\tremoveEditView() {\n\t\tsuper.removeEditView();\n\t\tthis.editor = null;\n\t}\n\n\tsetEditViewDataDone() {\n\t\tsuper.setEditViewDataDone();\n\t\tthis.initInsideEditorData();\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tvar $this = this;\n\t\tthis.setIsChanged( target );\n\t\tthis.setMassEditingFieldsWhenFormChange( target );\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\t\tswitch ( key ) {\n\t\t\tcase 'group_id':\n\t\t\t\tvar filter = {};\n\t\t\t\tfilter.filter_data = {};\n\t\t\t\t// why need [c_value, -1], -1 will return all, the filter won't work correct if send -1,remove for testting\n\t\t\t\tfilter.filter_data.group_id = [c_value];\n\t\t\t\tthis.kpi_api['get' + this.kpi_api.key_name]( filter, false, true, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\t$this.setInsideEditorData( res );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tthis.current_edit_record[key] = c_value;\n\t\t\t\tif ( !doNotValidate ) {\n\t\t\t\t\tthis.validate();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonInsideFormItemChange( target, doNotValidate ) {\n\t\ttarget.clearErrorStyle();\n\n\t\tvar key = target.getField();\n\t\tvar c_value = target.getValue();\n\t\tswitch ( key ) {\n\t\t\tcase 'rating':\n\t\t\t\tvar minimum_rate = parseInt( target.attr( 'minimum_rate' ) );\n\t\t\t\tvar maximum_rate = parseInt( target.attr( 'maximum_rate' ) );\n\t\t\t\tif ( c_value !== '' ) {\n\t\t\t\t\tc_value = parseInt( c_value );\n\t\t\t\t\tif ( c_value >= minimum_rate && c_value <= maximum_rate ) {\n\t\t\t\t\t\ttarget.clearErrorStyle();\n\t\t\t\t\t\tthis.parent_controller.setEditMenu();\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.setErrorStyle( $.i18n._( 'Rating must between' ) + ' ' + minimum_rate + ' ' + $.i18n._( 'and' ) + ' ' + maximum_rate, true );\n\t\t\t\t\t\tthis.parent_controller.setErrorMenu();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tinitInsideEditorData() {\n\n\t\tvar $this = this;\n\t\tvar args = {};\n\t\targs.filter_data = {};\n\n\t\tif ( this.current_edit_record.id ) {\n\n\t\t\targs.filter_data.user_review_control_id = this.current_edit_record['id'];\n\n\t\t\t$this.user_review_api['get' + $this.user_review_api.key_name]( args, true, {\n\t\t\t\tonResult: function( res ) {\n\t\t\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t$this.setInsideEditorData( res );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\t/* jshint ignore:start */\n\n\tsetInsideEditorData( res ) {\n\t\tvar data = res.getResult();\n\t\tvar len = data.length;\n\n\t\tif ( len > 0 ) {\n\n\t\t\tif ( !this.editor ) {\n\t\t\t\tthis.initInsideEditorUI();\n\t\t\t}\n\n\t\t\tvar serial = 1;\n\t\t\tfor ( var key in data ) {\n\t\t\t\tvar row = data[key];\n\t\t\t\tvar is_existed = false;\n\t\t\t\tif ( !row.kpi_id ) {\n\t\t\t\t\trow.kpi_id = row.id;\n\t\t\t\t\trow.id = false;\n\t\t\t\t}\n\t\t\t\t// the row.kpi_id if existed in this.editor.editor_data?\n\t\t\t\tif ( this.editor.editor_data ) {\n\n\t\t\t\t\tfor ( var i = 0; i < this.editor.editor_data.length; i++ ) {\n\t\t\t\t\t\tvar item = this.editor.editor_data[i];\n\t\t\t\t\t\tif ( row.kpi_id === item.kpi_id ) {\n\t\t\t\t\t\t\tis_existed = true; // the current row has already displayed.\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( !is_existed ) {\n\t\t\t\t\t\tserial = this.editor.editor_data.length + 1;\n\t\t\t\t\t\trow.serial = serial;\n\t\t\t\t\t\tthis.editor.editor_data.push( row );\n\t\t\t\t\t}\n\n//\t\t\t\t\tserial++;\n\n\t\t\t\t} else {\n\t\t\t\t\trow.serial = serial;\n\t\t\t\t\tdata[key] = row;\n\t\t\t\t\tserial++;\n\t\t\t\t}\n\n\t\t\t\tif ( !is_existed ) {\n\t\t\t\t\tthis.editor.addRow( row );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tif ( !this.editor.editor_data ) {\n\t\t\t\tthis.original_user_review_data = _.map( data, _.clone );\n\t\t\t\tfor ( let i = 0; i < this.original_user_review_data.length; i++ ) {\n\t\t\t\t\t//Need to convert these jQuery objects to their values so thwt future data change comparisons do not fail.\n\t\t\t\t\tif ( this.original_user_review_data[i].hasOwnProperty( 'rating' ) && this.original_user_review_data[i].rating !== false ) {\n\t\t\t\t\t\tthis.original_user_review_data[i].rating = this.original_user_review_data[i].rating.getValue();\n\t\t\t\t\t}\n\t\t\t\t\tif ( this.original_user_review_data[i].hasOwnProperty( 'note' ) && this.original_user_review_data[i].note !== false ) {\n\t\t\t\t\t\tthis.original_user_review_data[i].note = this.original_user_review_data[i].note.getValue();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tthis.editor.editor_data = data;\n\t\t\t}\n\n\t\t}\n\n//\t\t$this.editor.setValue( data );\n\t}\n\n\t/* jshint ignore:end */\n\n//\tinsideEditorSetValue( val ) {\n//\t\tvar len = val.length;\n//\t\tthis.removeAllRows();\n//\n//\t\tif ( len > 0 ) {\n//\t\t\tvar serial = 1;\n//\t\t\tfor ( var i = 0; i < val.length; i++ ) {\n//\t\t\t\tif ( Global.isSet( val[i] ) ) {\n//\t\t\t\t\tvar row = val[i];\n//\t\t\t\t\trow.serial = serial;\n//\t\t\t\t\tthis.addRow( row );\n//\t\t\t\t\tserial++;\n//\t\t\t\t}\n//\t\t\t}\n//\t\t}\n//\n//\t},\n\n\tinsideEditorAddRow( data ) {\n\t\tvar $this = this;\n\t\tif ( !data ) {\n//\t\t\tthis.getDefaultData();\n\t\t} else {\n\t\t\tvar row = this.getRowRender(); //Get Row render\n\t\t\tvar render = this.getRender(); //get render, should be a table\n\t\t\tvar widgets = data; //Save each row's widgets\n\n\t\t\t//Build row widgets\n\n\t\t\t// #\n\t\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'serial', width: 50 } );\n\t\t\tform_item_input.setValue( data.serial ? data.serial : null );\n//\t\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\t\trow.children().eq( 0 ).append( form_item_input );\n\n\t\t\t// Key Performance Indicator\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT );\n\t\t\tform_item_input.TText( { field: 'name', width: 600 } );\n\t\t\tform_item_input.setValue( data.name ? data.name : null );\n\t\t\tform_item_input.attr( 'title', data.description ? data.description : '' );\n\n\t\t\trow.children().eq( 1 ).append( form_item_input );\n\n\t\t\t// Rating\n\t\t\tif ( data.type_id == 10 ) {\n\t\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\t\t\t\tform_item_input.TTextInput( { field: 'rating', width: 40 } );\n\t\t\t\tform_item_input.setValue( data.rating ? data.rating : null );\n\t\t\t\tform_item_input.attr( { 'minimum_rate': data.minimum_rate, 'maximum_rate': data.maximum_rate } );\n\t\t\t\tform_item_input.bind( 'formItemChange', function( e, target, doNotValidate ) {\n\t\t\t\t\t$this.onFormItemChange( target, doNotValidate );\n\t\t\t\t} );\n\t\t\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\t\t\trow.children().eq( 2 ).append( form_item_input );\n\n\t\t\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t\t} else if ( data.type_id == 20 ) {\n\t\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\t\tform_item_input.TCheckbox( { field: 'rating' } );\n\t\t\t\tform_item_input.setValue( data.rating ? ( data.rating >= 1 ? true : false ) : null ); //Rating is numeric, so make sure we pass true/false to TCheckbox.\n\t\t\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\t\t\trow.children().eq( 2 ).append( form_item_input );\n\n\t\t\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\t\t\t}\n\n\t\t\t// Note\n\t\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\t\tform_item_input.TTextArea( {\n\t\t\t\tfield: 'note',\n\t\t\t\tstyle: { width: '300px', height: '20px', 'min-height': '10px' }\n\t\t\t} );\n\t\t\tform_item_input.setValue( data.note ? data.note : null );\n\t\t\twidgets[form_item_input.getField()] = form_item_input;\n\t\t\trow.children().eq( 3 ).css( 'text-align', 'right' ).append( form_item_input );\n\t\t\tthis.setWidgetEnableBaseOnParentController( form_item_input );\n\n\t\t\t// end\n\n\t\t\tif ( this.rows_widgets_array.length === 0 ) {\n\t\t\t\t$( render ).append( row );\n\t\t\t} else {\n\t\t\t\t// Get all rows and insert new row according to it's display_order\n\t\t\t\tlet rows = render.find( 'tr' ).get();\n\n\t\t\t\tdata.display_order = parseInt( data.display_order ) || 0;\n\n\t\t\t\tfor ( let i = 0; i < rows.length; i++ ) {\n\t\t\t\t\t// Loop looks for the correct spot to insert the new row based on the value of display_order.\n\t\t\t\t\t// If the last row is undefined or the value of display_order is less than the row to be inserted and the row after this is undefined or has a higher display_order, insert it there.\n\t\t\t\t\tif ( ( i === 0 || $( rows[i] ).attr( 'data-order' ) <= data.display_order ) && ( rows[i + 1] === undefined || $( rows[i + 1] ).attr( 'data-order' ) >= data.display_order ) ) {\n\t\t\t\t\t\t$( rows[i] ).after( row );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Now that the rows are in the correct order, renumber them.\n\t\t\t\trows = render.find( 'tr' ).get();\n\t\t\t\tlet order_number = 1;\n\t\t\t\tfor ( let i = 0; i < rows.length; i++ ) {\n\t\t\t\t\tif ( i !== 0 ) {\n\t\t\t\t\t\t$( rows[i] ).find( \"td:first\" ).text( order_number );\n\t\t\t\t\t\torder_number++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( this.parent_controller.is_viewing ) {\n\t\t\t\trow.find( '.control-icon' ).hide();\n\t\t\t}\n\n\t\t\tthis.rows_widgets_array.push( widgets );\n\n\t\t\tthis.addIconsEvent( row ); //Bind event to add and minus icon\n\t\t\tthis.removeLastRowLine();\n\n\t\t\t// Attach display_order to the <tr> for easy reordering after adding new KPI groups.\n\t\t\trow.attr('data-order', data.display_order);\n\t\t}\n\t}\n\n\tinsideEditorRemoveRow( row ) {\n\t\tvar index = row[0].rowIndex - 1;\n\t\tvar remove_id = this.rows_widgets_array[index].current_edit_item.id;\n\t\tif ( TTUUID.isUUID( remove_id ) && remove_id != TTUUID.zero_id && remove_id != TTUUID.not_exist_id ) {\n\t\t\tthis.delete_ids.push( remove_id );\n\t\t}\n\t\trow.remove();\n\t\tthis.rows_widgets_array.splice( index, 1 );\n\t\tthis.removeLastRowLine();\n\t}\n\n\tonSaveResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search();\n\t\t\t\t$this.onSaveDone( result );\n\n\t\t\t\t$this.removeEditView();\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorMenu();\n\t\t\t$this.setErrorTips( result );\n\n\t\t}\n\t}\n\n\t// onSaveAndContinueResult( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t//\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onEditClick( $this.refresh_id, true );\n\t//\n\t// \t\t\t$this.onSaveAndContinueDone( result );\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\tonEditClick( editId, noRefreshUI ) {\n\t\tvar $this = this;\n\t\tif ( $this.editor ) {\n\t\t\t$this.editor.remove();\n\t\t\t$this.editor = null;\n\t\t}\n\n\t\tsuper.onEditClick( editId, noRefreshUI );\n\t}\n\n\tsaveInsideEditorData( callBack ) {\n\t\tvar $this = this;\n\n\t\tif ( !this.editor ) {\n\t\t\tcallBack();\n\t\t} else {\n\t\t\tvar data = this.editor.getValue( this.refresh_id );\n\t\t\tlet changed_data = this.getChangedRecords( data, this.original_user_review_data, [] );\n\n\t\t\tif ( Array.isArray( changed_data ) && changed_data.length > 0 ) {\n\t\t\t\tthis.user_review_api.setUserReview( changed_data, {\n\t\t\t\t\tonResult: function( res ) {\n\t\t\t\t\t\tcallBack();\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tcallBack();\n\t\t\t}\n\n\t\t}\n\t}\n\n\tinsideEditorGetValue( current_edit_item_id ) {\n\t\tvar len = this.rows_widgets_array.length;\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar row = this.rows_widgets_array[i];\n\t\t\tif ( row.rating ) {\n\t\t\t\trow.rating = row.rating.getValue();\n\t\t\t}\n\t\t\trow.note = row.note.getValue();\n\n\t\t\trow.user_review_control_id = current_edit_item_id;\n\n\t\t\tthis.rows_widgets_array[i] = row;\n\t\t}\n\n\t\treturn this.rows_widgets_array;\n\t}\n\n\t_continueDoCopyAsNew() {\n\n\t\tvar $this = this;\n\t\tthis.is_add = true;\n\n\t\tLocalCacheData.current_doing_context_action = 'copy_as_new';\n\n\t\tif ( Global.isSet( this.edit_view ) ) {\n\n\t\t\tthis.current_edit_record.id = '';\n\t\t\tvar navigation_div = this.edit_view.find( '.navigation-div' );\n\t\t\tnavigation_div.css( 'display', 'none' );\n\t\t\tif ( this.editor ) {\n\t\t\t\tthis.editor.remove();\n\t\t\t\tthis.editor = null;\n\t\t\t}\n\t\t\tthis.setEditMenu();\n\t\t\tthis.setTabStatus();\n\t\t\tthis.is_changed = false;\n\t\t\tProgressBar.closeOverlay();\n\n\t\t} else {\n\t\t\tsuper._continueDoCopyAsNew();\n\t\t}\n\t}\n\n\tonSaveAndNewResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search( false );\n\t\t\t\tif ( $this.editor ) {\n\t\t\t\t\t$this.editor.remove();\n\t\t\t\t\t$this.editor = null;\n\t\t\t\t}\n\t\t\t\t$this.onAddClick( true );\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorTips( result );\n\t\t\t$this.setErrorMenu();\n\t\t}\n\t}\n\n\tonSaveAndCopyResult( result ) {\n\t\tvar $this = this;\n\t\tif ( result.isValid() ) {\n\t\t\tvar result_data = result.getResult();\n\t\t\tif ( result_data === true ) {\n\t\t\t\t$this.refresh_id = $this.current_edit_record.id;\n\n\t\t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t\t\t\t$this.refresh_id = result_data;\n\t\t\t}\n\n\t\t\t$this.saveInsideEditorData( function() {\n\t\t\t\t$this.search( false );\n\t\t\t\tif ( $this.editor ) {\n\t\t\t\t\t$this.editor.remove();\n\t\t\t\t\t$this.editor = null;\n\t\t\t\t}\n\t\t\t\t$this.onCopyAsNewClick();\n\t\t\t} );\n\n\t\t} else {\n\t\t\t$this.setErrorTips( result );\n\t\t\t$this.setErrorMenu();\n\t\t}\n\t}\n\n\t// onSaveAndNextResult( result ) {\n\t// \tvar $this = this;\n\t// \tif ( result.isValid() ) {\n\t// \t\tvar result_data = result.getResult();\n\t// \t\tif ( result_data === true ) {\n\t// \t\t\t$this.refresh_id = $this.current_edit_record.id;\n\t// \t\t} else if ( TTUUID.isUUID( result_data ) && result_data != TTUUID.zero_id && result_data != TTUUID.not_exist_id ) {\n\t// \t\t\t$this.refresh_id = result_data;\n\t// \t\t}\n\t//\n\t// \t\t$this.saveInsideEditorData( function() {\n\t// \t\t\t$this.onRightArrowClick();\n\t// \t\t\t$this.search( false );\n\t// \t\t\t$this.onSaveAndNextDone( result );\n\t// \t\t} );\n\t//\n\t// \t} else {\n\t// \t\t$this.setErrorTips( result );\n\t// \t\t$this.setErrorMenu();\n\t// \t}\n\t// },\n\n\tonRightArrowClick() {\n\t\tif ( this.editor ) {\n\t\t\tthis.editor.remove();\n\t\t\tthis.editor = null;\n\t\t}\n\t\tsuper.onRightArrowClick();\n\t}\n\n\tonLeftArrowClick() {\n\t\tif ( this.editor ) {\n\t\t\tthis.editor.remove();\n\t\t\tthis.editor = null;\n\t\t}\n\t\tsuper.onLeftArrowClick();\n\t}\n\n\tsearchDone() {\n\t\tsuper.searchDone();\n\t\tTTPromise.resolve( 'ReviewView', 'init' );\n\t}\n\n\tsetDefaultMenuReportRelatedIcons( context_btn, grid_selected_length, pId ) {\n\t\tif ( !this.payStubReportIconsValidate() ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( grid_selected_length > 0 && this.viewOwnerOrChildPermissionValidate() ) {\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\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'pdf_review_print':\n\t\t\t\tif ( grid_selected_length > 0 && this.viewOwnerOrChildPermissionValidate() ) {\n\t\t\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t\t\t} else {\n\t\t\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tdoFormIFrameCall( postData ) {\n\t\tGlobal.APIFileDownload( 'APIKPIReport', 'getKPIReport', postData );\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tvar $this = this;\n\n\t\tswitch ( id ) {\n\t\t\tcase 'pdf_review_print':\n\t\t\t\tvar grid_selected_id_array;\n\n\t\t\t\tvar ids = [];\n\t\t\t\tif ( $this.edit_view && $this.current_edit_record.id ) {\n\t\t\t\t\tids.push( $this.current_edit_record.id );\n\t\t\t\t} else {\n\t\t\t\t\tgrid_selected_id_array = this.getGridSelectIdArray();\n\t\t\t\t\t$.each( grid_selected_id_array, function( index, value ) {\n\t\t\t\t\t\tvar grid_selected_row = $this.getRecordFromGridById( value );\n\t\t\t\t\t\tids.push( grid_selected_row.id );\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tthis.doFormIFrameCall( { 0: { 'user_review_control_id': ids }, 1: 'pdf_review_print' } );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tgetUserReviewTabHtml() {\n\t\treturn `<div id=\"tab_review\" class=\"edit-view-tab-outside\">\n\t\t\t\t\t<div class=\"edit-view-tab\" id=\"tab_review_content_div\">\n\t\t\t\t\t\t<div class=\"first-column\"></div>\n\t\t\t\t\t\t<div class=\"second-column\"></div>\n\t\t\t\t\t\t<div class=\"third-column full-width-column\">\n\t\t\t\t\t\t\t<div class=\"third-column-form-item\" style=\"margin-left: 40%\">\n\t\t\t\t\t\t\t\t<div class=\"column-form-item-label\"></div>\n\t\t\t\t\t\t\t\t<div class=\"column-form-item-input\"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"inside-editor-div full-width-column\"></div>\n\t\t\t\t\t\t<div class=\"forth-column full-width-column border-column\"></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>`;\n\t}\n}\n\nUserReviewControlViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\tGlobal.loadViewSource( 'UserReviewControl', 'SubUserReviewControlView.html', function( result ) {\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( beforeViewLoadedFun ) ) {\n\t\t\tbeforeViewLoadedFun();\n\t\t}\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\t\t\tif ( Global.isSet( afterViewLoadedFun ) ) {\n\t\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\t\tafterViewLoadedFun( sub_user_review_control_view_controller );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t} );\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNzQ1NC5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFDSDs7OztBQUlBO0FBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7O0FBRUE7O0FBRUE7O0FBRUE7O0FBRUE7QUFDQSxJQUFJOztBQUVKO0FBQ0E7O0FBRUE7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQSwyQkFBMkIsQ0FBQztBQUM1QiwwQkF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