TimeTrex/interface/html5/dist/attendance-exceptions-ExceptionViewController.bundle.js

1 line
43 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-exceptions-ExceptionViewController"],{961:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"ExceptionViewController\": () => (/* binding */ ExceptionViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass ExceptionViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#exception_view_container',\n\t\t\tstatus_array: null,\n\n\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 = 'ExceptionEditView.html';\n\t\tthis.permission_id = 'punch';\n\t\tthis.viewId = 'Exception';\n\t\tthis.script_name = 'ExceptionView';\n\t\tthis.context_menu_name = $.i18n._( 'Exceptions' );\n\t\tthis.navigation_label = $.i18n._( 'Exception' );\n\t\tthis.api = TTAPI.APIException;\n\n\t\tthis.initPermission();\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 'edit_employee':\n\t\t\tcase 'edit_pay_period':\n\t\t\tcase 'edit_pay_period_schedule':\n\t\t\tcase 'schedule':\n\t\t\tcase 'timesheet':\n\t\t\tcase 'send_message':\n\t\t\t\tthis.onNavigationClick( id );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'timesheet':\n\t\t\t\tthis.setDefaultMenuViewIcon( context_btn, grid_selected_length, 'punch' );\n\t\t\t\tbreak;\n\t\t\tcase 'schedule':\n\t\t\t\tthis.setDefaultMenuViewIcon( context_btn, grid_selected_length, 'schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'edit_employee':\n\t\t\t\tthis.setDefaultMenuEditEmployeeIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t\tcase 'edit_pay_period_schedule':\n\t\t\t\tthis.setDefaultMenuEditIcon( context_btn, grid_selected_length, 'pay_period_schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'edit_pay_period':\n\t\t\t\tthis.setDefaultMenuEditIcon( context_btn, grid_selected_length, 'pay_period_schedule' );\n\t\t\t\tbreak;\n\t\t\tcase 'send_message':\n\t\t\t\tthis.setDefaultMenuSendMessageIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t}\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\tautoOpenEditViewIfNecessary() {\n\t\t//Auto open edit view. Should set in IndexController\n\t\t//Don't have any edit view\n\t\t//Error: Uncaught TypeError: undefined is not a function in /interface/html5/views/BaseViewController.js?v=7.4.3-20140924-084605 line 2751\n\t\tthis.autoOpenEditOnlyViewIfNecessary();\n\t}\n\n\tsetDefaultMenuEditEmployeeIcon( context_btn, grid_selected_length ) {\n\t\tif ( !this.editChildPermissionValidate( 'user' ) ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, false )\n\t\t}\n\n\t\tif ( grid_selected_length === 1 ) {\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\tsetDefaultMenuSendMessageIcon( context_btn, grid_selected_length, pId ) {\n\t\tif ( grid_selected_length > 0 ) {\n\t\t\tContextMenuManager.hideMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes().id, context_btn.id, true );\n\t\t} else {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMountAttributes()