TimeTrex/interface/html5/dist/my_account-timesheet_authorization-TimeSheetAuthorizationViewController.bundle.js

1 line
150 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["my_account-timesheet_authorization-TimeSheetAuthorizationViewController"],{8121:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"TimeSheetAuthorizationViewController\": () => (/* binding */ TimeSheetAuthorizationViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass TimeSheetAuthorizationViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#time_sheet_authorization_view_container',\n\n\t\t\ttype_array: null,\n\t\t\thierarchy_level_array: null,\n\n\t\t\tmessages: null,\n\n\t\t\tmessage_control_api: null,\n\n\t\t\tauthorization_api: null,\n\n\t\t\trequest_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 = 'TimeSheetAuthorizationEditView.html';\n\t\tthis.permission_id = 'punch';\n\t\tthis.viewId = 'TimeSheetAuthorization';\n\t\tthis.script_name = 'TimeSheetAuthorizationView';\n\t\tthis.table_name_key = 'pay_period_time_sheet_verify';\n\t\tthis.context_menu_name = $.i18n._( 'TimeSheet (Authorizations)' );\n\t\tthis.navigation_label = $.i18n._( 'TimeSheet' );\n\t\tthis.api = TTAPI.APIPayPeriodTimeSheetVerify;\n\t\tthis.request_api = TTAPI.APIRequest;\n\t\tthis.message_control_api = TTAPI.APIMessageControl;\n\t\tthis.authorization_api = TTAPI.APIAuthorization;\n\t\tthis.event_bus = new TTEventBus({ view_id: this.viewId });\n\n\t\tthis.render();\n\t\tthis.buildContextMenu( true );\n\n\t\tthis.initData();\n\n\t\tthis.hierarchy_type_id = 90;\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\t\tvar res = this.request_api.getHierarchyLevelOptions( [-1], { async: false } );\n\t\tvar data = res.getResult();\n\t\t$this['hierarchy_level_array'] = Global.buildRecordArray( data );\n\t\tif ( Global.isSet( $this.basic_search_field_ui_dic['hierarchy_level'] ) ) {\n\t\t\t$this.basic_search_field_ui_dic['hierarchy_level'].setSourceData( Global.buildRecordArray( data ) );\n\t\t}\n\t}\n\n\tsearch( set_default_menu, page_action, page_number, callBack ) {\n\t\tthis.refresh_id = null;\n\t\tthis.updateBadgeCount();\n\t\tsuper.search( set_default_menu, page_action, page_number, callBack );\n\t}\n\n\tupdateBadgeCount() {\n\t\tthis.event_bus.emit( 'tt_topbar', 'profile_pending_counts', { //Update \"My Profile\" badge.\n\t\t\tobject_types: [ 'notification', 'timesheet_authorization' ]\n\t\t} );\n\t}\n\n\tprocessResultData( result_data ) {\n\t\tvar len = result_data.length;\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar item = result_data[i];\n\t\t\tif ( item.id == TTUUID.not_exist_id ) {\n\t\t\t\titem.id = item.user_id + '_' + item.pay_period_id;\n\t\t\t}\n\t\t}\n\n\t\treturn result_data;\n\t}\n\n\tparseToRecordId( id, index ) {\n\t\tif ( !id ) {\n\t\t\treturn false;\n\t\t}\n\t\tid = id.toString();\n\t\tif ( id.indexOf( '_' ) > 0 ) {\n\t\t\tif ( index >= 0 ) {\n\t\t\t\treturn id.split( '_' )[index];\n\t\t\t}\n\t\t\treturn TTUUID.not_exist_id;\n\t\t} else {\n\t\t\treturn id;\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\taction: {\n\t\t\t\t\tlabel: $.i18n._( 'Action' ),\n\t\t\t\t\tid: this.script_name + 'action'\n\t\t\t\t},\n\t\t\t\tauthorization: {\n\t\t\t\t\tlabel: $.i18n._( 'Authorization' ),\n\t\t\t\t\tid: this.script_name + 'authorization'\n\t\t\t\t},\n\t\t\t\tobjects: {\n\t\t\t\t\tlabel: $.i18n._( 'Objects' ),\n\t\t\t\t\tid: this.script_name + 'objects'\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: ['default'],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'View' ),\n\t\t\t\t\tid: 'view',\n\t\t\t\t\tgroup: 'action',\n\t\t\t\t\tvue_icon: 'tticon tticon-visibility_black_24dp',\n\t\t\t\t\tshow_on_right_click: true,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Cancel' ),\n\t\