TimeTrex/interface/html5/dist/attendance-in_out-InOutViewController.bundle.js

1 line
84 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-in_out-InOutViewController"],{1690:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"InOutViewController\": () => (/* binding */ InOutViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass InOutViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\n\t\t\ttype_array: null,\n\n\t\t\tjob_api: null,\n\t\t\tjob_item_api: null,\n\t\t\tpunch_tag_api: null,\n\t\t\tuser_api: null,\n\t\t\tdepartment_api: null,\n\t\t\tsystem_job_queue_api: null,\n\n\t\t\tdefault_punch_tag: [],\n\t\t\tprevious_punch_tag_selection: [],\n\n\t\t\told_type_status: {},\n\n\t\t\tshow_job_ui: false,\n\t\t\tshow_job_item_ui: false,\n\t\t\tshow_punch_tag_ui: false,\n\t\t\tshow_branch_ui: false,\n\t\t\tshow_department_ui: false,\n\t\t\tshow_good_quantity_ui: false,\n\t\t\tshow_bad_quantity_ui: false,\n\t\t\tshow_transfer_ui: false,\n\t\t\tshow_node_ui: false,\n\n\t\t\toriginal_note: false,\n\t\t\tnew_note: false,\n\n\t\t\tdo_not_prevalidate: true //Help reduce server load by skipping prevalidation. Enabled if validation fails during save.\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\tGlobal.setUINotready( true );\n\n\t\tthis.permission_id = 'punch';\n\t\tthis.viewId = 'InOut';\n\t\tthis.script_name = 'InOutView';\n\t\tthis.table_name_key = 'punch';\n\t\tthis.context_menu_name = $.i18n._( 'In/Out' );\n\t\tthis.api = TTAPI.APIPunch;\n\t\tthis.system_job_queue_api = TTAPI.APISystemJobQueue;\n\t\tthis.event_bus = new TTEventBus({ view_id: this.viewId });\n\n\t\t//Tried to fix Cannot call method 'getJobItem' of null. Use ( Global.getProductEdition() >= 20 )\n\t\tif ( ( Global.getProductEdition() >= 20 ) ) {\n\t\t\tthis.job_api = TTAPI.APIJob;\n\t\t\tthis.job_item_api = TTAPI.APIJobItem;\n\t\t\tthis.punch_tag_api = TTAPI.APIPunchTag;\n\t\t\tthis.user_api = TTAPI.APIUser;\n\t\t\tthis.department_api = TTAPI.APIDepartment;\n\t\t}\n\n\t\tthis.render();\n\t\t// this.buildContextMenu(); // #VueContextMenu#EditOnly - Commented out as must happen after initEditViewUI\n\n\t\tthis.initPermission();\n\n\t\tthis.initData();\n\t\tthis.is_changed = true;\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['default'],\n\t\t\tinclude: ['save', 'cancel']\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\taddPermissionValidate( p_id ) {\n\t\tif ( !Global.isSet( p_id ) ) {\n\t\t\tp_id = this.permission_id;\n\t\t}\n\n\t\tif ( p_id === 'report' ) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif ( PermissionManager.validate( p_id, 'punch_in_out' ) ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\n\tjobUIValidate() {\n\t\tif ( PermissionManager.validate( 'job', 'enabled' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_job' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tjobItemUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_job_item' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tpunchTagUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_punch_tag' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbranchUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_branch' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tdepartmentUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_department' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tgoodQuantityUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_quantity' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}\n\n\tbadQuantityUIValidate() {\n\t\tif ( PermissionManager.validate( 'punch', 'edit_quantity' ) &&\n\t\t\tPermissionManager.validate( 'punch', 'edit_bad_quantity' ) ) {\n\t\t\treturn true;\n\t\t}\n\t\t