TimeTrex/interface/html5/dist/reports-saved_report-SavedReportViewController.bundle.js

1 line
41 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["reports-saved_report-SavedReportViewController"],{9372:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"SavedReportViewController\": () => (/* binding */ SavedReportViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass SavedReportViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#saved_report_view_container',\n\n\t\t\t//Issue #1187 - Many of these variables are needed when this view is rendered as a sub view\n\t\t\t//in that case, init() will not be run so those variables need to be defined at load time instead.\n\n\t\t\tsub_report_schedule_view_controller: null,\n\t\t\tedit_view_tpl: 'SavedReportEditView.html',\n\t\t\tpermission_id: 'report',\n\t\t\tviewId: 'SavedReport',\n\t\t\tscript_name: 'UserReportDataView',\n\t\t\ttable_name_key: 'user_report_data',\n\t\t\tcontext_menu_name: $.i18n._( 'Reports' ),\n\t\t\tnavigation_label: $.i18n._( 'Saved Report' ),\n\n\t\t\tapi: TTAPI.APIUserReportData\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\tthis.render();\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.buildContextMenu( true );\n\n\t\t\t//call init data in parent view, don't call initData\n\t\t} else {\n\t\t\tthis.buildContextMenu();\n\t\t\tif ( !this.sub_view_mode ) {\n\t\t\t\tthis.initData();\n\t\t\t}\n\t\t}\n\t}\n\n\tonDeleteResult( result, remove_ids ) {\n\t\tvar $this = this;\n\t\tProgressBar.closeOverlay();\n\n\t\tif ( result.isValid() ) {\n\t\t\t$this.search();\n\t\t\t$this.onDeleteDone( result );\n\n\t\t\tif ( $this.edit_view ) {\n\t\t\t\t$this.removeEditView();\n\t\t\t} else {\n\t\t\t\t$this.setCurrentEditViewState( '' );\n\t\t\t}\n\n\t\t\tif ( this.sub_view_mode && this.parent_view_controller ) {\n\t\t\t\tthis.parent_view_controller.onSavedReportDelete();\n\t\t\t}\n\n\t\t} else {\n\t\t\t$this.revertEditViewState();\n\t\t\tTAlertManager.showErrorAlert( result );\n\t\t}\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'share_report':\n\n\t\t\t\tif ( Global.getProductEdition() >= 15 ) {\n\t\t\t\t\tvar default_data = [];\n\t\t\t\t\tif ( this.edit_view && this.current_edit_record.id ) {\n\t\t\t\t\t\tdefault_data.push( this.current_edit_record.id );\n\t\t\t\t\t} else if ( !this.edit_view ) {\n\t\t\t\t\t\tdefault_data = this.getGridSelectIdArray();\n\t\t\t\t\t}\n\t\t\t\t\tIndexViewController.openWizard( 'ShareReportWizard', default_data );\n\t\t\t\t} else {\n\t\t\t\t\tTAlertManager.showAlert( Global.getUpgradeMessage() );\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonGridDblClickRow() {\n\t\tProgressBar.showOverlay();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tthis.onEditClick();\n\t\t} else {\n\t\t\tthis.onViewClick();\n\t\t}\n\t}\n\n\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\tshare: {\n\t\t\t\t\tlabel: $.i18n._( 'Share' ),\n\t\t\t\t\tid: this.viewId + 'Share'\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: ['default'],\n\t\t\tinclude: [\n\t\t\t\t'edit',\n\t\t\t\t'delete_icon',\n\t\t\t\t'delete_and_next',\n\t\t\t\t'save',\n\t\t\t\t'save_and_continue',\n\t\t\t\t'save_and_next',\n\t\t\t\t'cancel',\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Share Report' ),\n\t\t\t\t\tid: 'share_report',\n\t\t\t\t\tmenu_align: 'right',\n\t\t\t\t\tvue_icon: 'tticon tticon-share_black_24dp',\n\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\tif ( !this.sub_view_mode ) {\n\t\t\tcontext_menu_model.include.unshift( {\n\t\t\t\tlabel: $.i18n._( 'Report' ),\n\t\t\t\tid: 'view',\n\t\t\t\tgroup: 'editor',\n\t\t\t\tvue_icon: 'tticon tticon-visibility_black_24dp',\n\t\t\t} );\n\t\t}\n\n\t\treturn context_menu_model;\n\t}\n\n\tremoveEditView() {\n\n\t\tsuper.removeEditView();\n\t\tthis.sub_report_schedule_view_controller = null;\n\t}\n\n\tgetGridSetup() {\n\t\tvar $this =