TimeTrex/interface/html5/dist/attendance-timesheet-UserDateTotalViewController.bundle.js

1 line
90 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-timesheet-UserDateTotalViewController"],{827:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserDateTotalViewController\": () => (/* binding */ UserDateTotalViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass UserDateTotalViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_date_total_view_container', //Must set el here and can only set string, so events can work\n\n\t\t\tpunch_tag_api: null,\n\t\t\tdefault_punch_tag: [],\n\t\t\tprevious_punch_tag_selection: []\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 = 'UserDateTotalEditView.html';\n\t\tthis.permission_id = 'user_date_total';\n\t\tthis.script_name = 'UserDateTotalView';\n\t\tthis.viewId = 'UserDateTotal';\n\t\tthis.table_name_key = 'user_date_total';\n\t\tthis.context_menu_name = $.i18n._( 'Accumulated Time' );\n\t\tthis.navigation_label = $.i18n._( 'Accumulated Time' );\n\t\tthis.api = TTAPI.APIUserDateTotal;\n\t\tthis.currency_api = TTAPI.APICurrency;\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}\n\n\t\tif ( PermissionManager.validate( this.permission_id, 'add' ) || PermissionManager.validate( this.permission_id, 'edit' ) ) {\n\t\t\t$( this.el ).find( '.warning-message' ).text( $.i18n._( 'WARNING: Manually modifying Accumulated Time records may prevent policies from being calculated properly and should only be done as a last resort when instructed to do so by a support representative.' ) );\n\t\t} else {\n\t\t\t$( this.el ).find( '.warning-message' ).hide();\n\t\t}\n\n\t\tthis.initPermission();\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\tsetGridSize() {\n\t\t// if ( ( !this.grid || !this.grid.grid.is( ':visible' ) ) ) {\n\t\t// \treturn;\n\t\t// }\n\t\t//this.grid.grid.setGridWidth( $( this.el ).parent().width() - 2 );\n\n\t\tvar message_offset = ( $( this.el ).find( '.warning-message' ).outerHeight() * 2 ) + 27;\n\t\tthis.grid.grid.setGridHeight( $( this.el ).parents( '#tab_user_date_total_parent' ).height() - message_offset );\n\t}\n\n\tsetGridCellBackGround() {\n\n\t\tvar data = this.grid.getGridParam( 'data' );\n\n\t\t//Error: TypeError: data is undefined in /interface/html5/framework/jquery.min.js?v=7.4.6-20141027-074127 line 2 > eval line 70\n\t\tif ( !data ) {\n\t\t\treturn;\n\t\t}\n\n\t\tvar len = data.length;\n\n\t\tfor ( var i = 0; i < len; i++ ) {\n\t\t\tvar item = data[i];\n\n\t\t\tif ( item.is_override === true ) {\n\t\t\t\t$( 'tr[id=\\'' + item.id + '\\']' ).addClass( 'user-data-total-override' );\n\t\t\t}\n\t\t}\n\t}\n\n\tinitOptions() {\n\t\tvar $this = this;\n\n\t\tthis.initDropDownOption( 'object_type' );\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\texclude: ['copy', 'export_excel'],\n\t\t\tinclude: ['default']\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tonFormItemChange( target, doNotValidate ) {\n\t\tvar $this = this;\n\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\tthis.current_edit_record[key] = c_value;\n\n\t\tswitch ( key ) {\n\t\t\tcase 'object_type_id':\n\t\t\t\tthis.onTypeChange( true );\n\t\t\t\tbreak;\n\t\t\tcase 'regular_policy_id':\n\t\t\tcase 'absence_policy_id':\n\t\t\tcase 'overtime_policy_id':\n\t\t\