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

1 line
16 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["attendance-timesheet-UserDateTotalParentViewController"],{1285:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"UserDateTotalParentViewController\": () => (/* binding */ UserDateTotalParentViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass UserDateTotalParentViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#user_date_total_parent_view_container',\n\t\t\tsub_user_date_total_view_controller: 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 = 'UserDateTotalParentEditView.html';\n\t\tthis.permission_id = 'punch';\n\t\tthis.script_name = 'UserDateTotalParentView';\n\t\tthis.viewId = 'UserDateTotalParent';\n\t\tthis.table_name_key = 'user_date_total_parent';\n\t\tthis.context_menu_name = $.i18n._( 'Accumulated Time' );\n\t\tthis.navigation_label = $.i18n._( 'Accumulated Time' );\n\t\tthis.api = TTAPI.APIUserDateTotal;\n\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\tremoveEditView() {\n\t\tsuper.removeEditView();\n\n\t\tif ( this.parent_view_controller && this.parent_view_controller.viewId === 'TimeSheet' ) {\n\t\t\tthis.parent_view_controller.onSubViewRemoved();\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\treturn {\n\t\t\tinclude:\n\t\t\t\t['cancel'],\n\t\t\texclude:\n\t\t\t\t['default']\n\t\t};\n\t}\n\n\topenEditView( date_str ) {\n\n\t\tvar $this = this;\n\n\t\tif ( $this.edit_only_mode ) {\n\n\t\t\tTTPromise.add( 'UserDateTotalParent', 'init' );\n\t\t\tif ( !$this.edit_view ) {\n\t\t\t\t$this.initEditViewUI( $this.viewId, $this.edit_view_tpl );\n\t\t\t}\n\n\t\t\tvar date_stamp = Global.strToDate( date_str, 'YYYY-MM-DD' ).format();\n\n\t\t\t$this.current_edit_record = {\n\t\t\t\tdate: date_str,\n\t\t\t\tuser_id: LocalCacheData.getAllURLArgs().user_id,\n\t\t\t\tdate_stamp: date_stamp\n\t\t\t};\n\t\t\tTTPromise.wait( 'UserDateTotalParent', 'init', function() {\n\t\t\t\t$this.initEditView();\n\t\t\t} );\n\n\t\t} else {\n\t\t\tif ( !this.edit_view ) {\n\t\t\t\tthis.initEditViewUI( $this.viewId, $this.edit_view_tpl );\n\t\t\t}\n\n\t\t}\n\t}\n\n\tbuildSearchFields() {\n\t\tsuper.buildSearchFields();\n\t\tthis.search_fields = [];\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_user_date_total_parent': {\n\t\t\t\t'label': $.i18n._( 'Accumulated Time' ),\n\t\t\t\t'html_template': this.getUserDateTotalParentTabHTML(),\n\t\t\t},\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tTTPromise.resolve( 'UserDateTotalParent', 'init' );\n\t}\n\n\tsetCurrentEditRecordData() {\n\n\t\tthis.edit_view_tab.find( '#tab_user_date_total_parent' ).find( '.first-column-sub-view' ).css( 'display', 'block' );\n\t\tthis.initSubUserDateTotalView( 'tab_user_date_total_parent' );\n\t\tthis.setEditViewDataDone();\n\t}\n\n\tinitSubUserDateTotalView( tab_id ) {\n\t\tvar $this = this;\n\n\t\tif ( this.sub_user_date_total_view_controller ) {\n\t\t\tthis.sub_user_date_total_view_controller.buildContextMenu( true );\n\t\t\tthis.sub_user_date_total_view_controller.setDefaultMenu();\n\t\t\t$this.sub_user_date_total_view_controller.parent_edit_record = $this.current_edit_record;\n\t\t\t$this.sub_user_date_total_view_controller.getSubViewFilter = function( filter ) {\n\n\t\t\t\treturn getFilter( filter, this );\n\t\t\t};\n\n\t\t\t$this.sub_user_date_total_view_controller.initData();\n\t\t\treturn;\n\t\t}\n\n\t\tGlobal.loadScript( 'views/attendance/timesheet/UserDat