TimeTrex/interface/html5/dist/document-DocumentRevisionViewController.bundle.js

1 line
22 KiB
JavaScript
Raw Permalink Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["document-DocumentRevisionViewController"],{4120:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"DocumentRevisionViewController\": () => (/* binding */ DocumentRevisionViewController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass DocumentRevisionViewController extends BaseViewController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '#document_revision_view_container'\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\n\t\t//this._super('initialize', options );\n\t\tthis.edit_view_tpl = 'DocumentRevisionEditView.html';\n\t\tthis.permission_id = 'document';\n\t\tthis.viewId = 'DocumentRevision';\n\t\tthis.script_name = 'DocumentRevisionView';\n\t\tthis.table_name_key = 'document_revision';\n\t\tthis.context_menu_name = $.i18n._( 'Revisions' );\n\t\tthis.navigation_label = $.i18n._( 'Revision' );\n\t\tthis.api = TTAPI.APIDocumentRevision;\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\tgetCustomContextMenuModel() {\n\t\tvar context_menu_model = {\n\t\t\tgroups: {\n\t\t\t\tdownload: {\n\t\t\t\t\tlabel: $.i18n._( 'Download' ),\n\t\t\t\t\tid: this.script_name + 'download'\n\t\t\t\t}\n\t\t\t},\n\t\t\texclude: [\n\t\t\t\t'export_excel',\n\t\t\t\t'mass_edit',\n\t\t\t\t'copy'\n\t\t\t],\n\t\t\tinclude: [\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'Download' ),\n\t\t\t\t\tid: 'download',\n\t\t\t\t\tgroup: 'download',\n\t\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tlabel: $.i18n._( 'View' ),\n\t\t\t\t\tid: 'view_file',\n\t\t\t\t\tgroup: 'download',\n\t\t\t\t\t}\n\t\t\t]\n\t\t};\n\n\t\treturn context_menu_model;\n\t}\n\n\tsetCustomDefaultMenuIcon( id, context_btn, grid_selected_length ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\tcase 'view_file':\n\t\t\t\tthis.setDefaultMenuDownIcon( context_btn, grid_selected_length );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tsetDefaultMenuDownIcon( context_btn, grid_selected_length, pId ) {\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\t//\n\t// setDefaultMenuCancelIcon( context_btn, grid_selected_length, pId ) {\n\t// \tif ( this.sub_view_mode ) {\n\t// \t\tcontext_btn.addClass( 'disable-image' );\n\t// \t}\n\t// },\n\n\tsetCustomEditMenuIcon( id, context_btn ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\tcase 'view_file':\n\t\t\t\tthis.setEditMenuDownloadIcon( context_btn );\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\t\tthis.onDownloadClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tonAddClick() {\n\t\tvar $this = this;\n\t\tthis.setCurrentEditViewState( 'new' );\n\t\t$this.openEditView();\n\n\t\tif ( this.sub_view_mode ) {\n\t\t\tif ( this.parent_key === 'document_id' ) {\n\n\t\t\t\tvar args = this.parent_value;\n\n\t\t\t\t$this.api['get' + $this.api.key_name + 'DefaultData']( args, {\n\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t$this.onAddResult( result );\n\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$this.api['get' + $this.api.key_name + 'DefaultData']( {\n\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t$this.onAddResult( result );\n\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\t}\n\n\tsetEditMenuDownloadIcon( context_btn, pId ) {\n\t\tif ( !this.current_edit_record || !this.current_edit_record.id ) {\n\t\t\tContextMenuManager.disableMenuItem( this.determineContextMenuMount