1 line
22 KiB
JavaScript
1 line
22 KiB
JavaScript
"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.determineContextMenuMountAttributes().id, context_btn.id, false );\n\t\t}\n\t}\n\n\thandleSaveResult( document_revision_result, super_fun_name ) {\n\t\tvar $this = this;\n\t\tvar document_revision_id = ( document_revision_result.getResult() === true && this.current_edit_record.id ) ? this.current_edit_record.id : document_revision_result.getResult();\n\n\t\tvar file_data = $this.file_browser.getValue();\n\n\t\t//Save a document revision data if has upload file, otherwise don't\n\t\tif ( file_data ) {\n\n\t\t\t$this.api.uploadFile( file_data, 'object_type=document_revision&object_id=' + document_revision_id, {\n\t\t\t\tonResult: ( upload_file_result ) => {\n\t\t\t\t\tsuper[super_fun_name]( document_revision_result );\n\t\t\t\t}\n\t\t\t} );\n\n\t\t} else {\n\t\t\tsuper[super_fun_name]( document_revision_result );\n\t\t}\n\t}\n\n\tonSaveResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveResult' );\n\t}\n\n\tonSaveAndContinueResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveAndContinueResult' );\n\t}\n\n\tonSaveAndNewResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveAndNewResult' );\n\t}\n\n\tonSaveAndCopyResult( result ) {\n\t\treturn this.handleSaveResult( result, 'onSaveAndCopyResult' );\n\t}\n\n\tonCustomContextClick( id ) {\n\t\tswitch ( id ) {\n\t\t\tcase 'download':\n\t\t\tcase 'view_file':\n\t\t\t\tthis.onDownloadClick();\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tdoFormIFrameCall() {\n\t\tvar url = ServiceCaller.getURLByObjectType( 'file_download' ) + '&object_type=document&parent_id=' + this.current_edit_record.document_id + '&object_id=' + this.current_edit_record.id;\n\t\tGlobal.APIFileDownload( null, null, null, url );\n\t}\n\n\tonDownloadClick() {\n\t\tvar $this = this;\n\t\tif ( this.edit_view && this.current_edit_record.id ) {\n\t\t\tthis.doFormIFrameCall();\n\n\t\t} else {\n\n\t\t\tvar filter = {};\n\n\t\t\tvar selectedId;\n\t\t\tvar grid_selected_id_array = this.getGridSelectIdArray();\n\t\t\tvar grid_selected_length = grid_selected_id_array.length;\n\t\t\tif ( grid_selected_length > 0 ) {\n\t\t\t\tselectedId = grid_selected_id_array[0];\n\t\t\t}\n\t\t\tfilter.filter_data = {};\n\t\t\tfilter.filter_data.id = [selectedId];\n\n\t\t\tvar result = this.api['get' + this.api.key_name]( filter, { async: false } );\n\t\t\tvar result_data = result.getResult();\n\n\t\t\tif ( !result_data ) {\n\t\t\t\tresult_data = [];\n\t\t\t}\n\n\t\t\tresult_data = result_data[0];\n\n\t\t\t$this.current_edit_record = result_data;\n\n\t\t\t$this.doFormIFrameCall();\n\n\t\t}\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_revision': { 'label': $.i18n._( 'Revision' ) },\n\t\t};\n\t\tthis.setTabModel( tab_model );\n\n\t\tthis.navigation.AComboBox( {\n\t\t\tapi_class: TTAPI.APIDocumentRevision,\n\t\t\tid: this.script_name + '_navigation',\n\t\t\tallow_multiple_selection: false,\n\t\t\tlayout_name: 'global_document_revison',\n\t\t\tnavigation_mode: true,\n\t\t\tshow_search_inputs: true\n\t\t} );\n\n\t\tthis.setNavigation();\n\n\t\t//Tab 0 start\n\n\t\tvar tab_revision = this.edit_view_tab.find( '#tab_revision' );\n\n\t\tvar tab_revision_column1 = tab_revision.find( '.first-column' );\n\n\t\tthis.edit_view_tabs[0] = [];\n\n\t\tthis.edit_view_tabs[0].push( tab_revision_column1 );\n\n\t\t// Revision\n\n\t\tvar form_item_input = Global.loadWidgetByName( FormItemType.TEXT_INPUT );\n\n\t\tform_item_input.TTextInput( { field: 'revision', width: 114 } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Revision' ), form_item_input, tab_revision_column1, '' );\n\n\t\t// File\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.FILE_BROWSER );\n\n\t\tthis.file_browser = form_item_input.TImageBrowser( { field: '', name: 'filedata', accept_filter: '*' } );\n\n\t\tthis.addEditFieldToColumn( $.i18n._( 'File' ), form_item_input, tab_revision_column1, '', null, false, true );\n\n\t\t// Change log\n\t\tform_item_input = Global.loadWidgetByName( FormItemType.TEXT_AREA );\n\t\tform_item_input.TTextArea( { field: 'change_log' } );\n\t\tthis.addEditFieldToColumn( $.i18n._( 'Change Log' ), form_item_input, tab_revision_column1, '', null, false, true );\n\n\t}\n\n}\n\nDocumentRevisionViewController.loadSubView = function( container, beforeViewLoadedFun, afterViewLoadedFun ) {\n\n\tGlobal.loadViewSource( 'DocumentRevision', 'SubDocumentRevisionView.html', function( result ) {\n\t\tvar args = {};\n\t\tvar template = _.template( result );\n\n\t\tif ( Global.isSet( beforeViewLoadedFun ) ) {\n\t\t\tbeforeViewLoadedFun();\n\t\t}\n\n\t\tif ( Global.isSet( container ) ) {\n\t\t\tcontainer.html( template( args ) );\n\t\t\tif ( Global.isSet( afterViewLoadedFun ) ) {\n\t\t\t\tTTPromise.wait( 'BaseViewController', 'initialize', function() {\n\t\t\t\t\tafterViewLoadedFun( sub_document_revision_view_controller );\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t} );\n};//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNDEyMC5qcyIsIm1hcHBpbmdzIjoiOzs7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