TimeTrex/interface/html5/dist/wizard-Wizard.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([["wizard-Wizard"],{3207:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Wizard\": () => (/* binding */ Wizard)\n/* harmony export */ });\n/* harmony import */ var _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6739);\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\n/**\n * For an example of implementation see: interface/html5/views/payroll/remittance_wizard/PayrollRemittanceAgencyEventWizard.js\n *\n * CRITICAL: ALL WIZARDS MUST HAVE A HOME STEP SO THAT THEY HAVE SOMEWHERE TO START.\n **/\n\n\n\nclass Wizard extends _views_TTBackboneView__WEBPACK_IMPORTED_MODULE_0__.TTBackboneView {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tcurrent_step: false,\n\t\t\twizard_id: 'generic_wizard',\n\t\t\twizard_name: $.i18n._( 'Wizard' ),\n\t\t\tstep_history: {},\n\t\t\tstep_objects: {},\n\t\t\tel: $( '.wizard' ),\n\t\t\tprevious_wizard: null,\n\t\t\t_step_map: null,\n\t\t\tdo_not_initialize_onload: false, //when this flag is set, initialize will not be run automagically.\n\t\t\texternal_data: null,\n\t\t\tevents: {\n\t\t\t\t'click .close-btn': 'onCloseClick',\n\t\t\t\t'click .close-icon': 'onCloseClick',\n\t\t\t\t'click .wizard-overlay.onclick-close': 'onCloseClick',\n\t\t\t\t'click .forward-btn': 'onNextClick',\n\t\t\t\t'click .back-btn': 'onPrevClick',\n\t\t\t\t'click .done-btn': 'onDone'\n\t\t\t}\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinitialize( options ) {\n\t\tsuper.initialize( options );\n\n\t\tif ( options && options.external_data ) {\n\t\t\tthis.setExternalData( options.external_data );\n\t\t}\n\n\t\tif ( !this.do_not_initialize_onload ) {\n\t\t\tthis.step_history = {};\n\t\t\tthis.step_objects = {};\n\t\t\tvar $this = this;\n\n\t\t\tthis.initStepObject( ( this.getCurrentStepName() ? this.getCurrentStepName() : 'home' ), function( obj ) {\n\t\t\t\t$this.init();\n\t\t\t\t$this.render();\n\t\t\t\t$this.enableButtons();\n\n\n\t\t\t\tif ( $this.wizard_id === null ) {\n\t\t\t\t\t$this.wizard_id = $this.constructor.name;\n\t\t\t\t}\n\n\t\t\t\tif ( LocalCacheData.current_open_wizard_controllers.some( wizard => wizard.wizard_id === $this.wizard_id ) ) {\n\t\t\t\t\t$this.previous_wizard = LocalCacheData.current_open_wizard_controllers.find( wizard => wizard.wizard_id === $this.wizard_id );\n\t\t\t\t} else {\n\t\t\t\t\t$this.previous_wizard = false;\n\t\t\t\t}\n\n\t\t\t\tLocalCacheData.current_open_wizard_controllers.push( $this );\n\t\t\t} );\n\t\t}\n\t}\n\n\t//always override\n\tinit() {\n\t\treturn;\n\t}\n\n\tsetExternalData( data ) {\n\t\tthis.external_data = data;\n\t}\n\n\tgetExternalData() {\n\t\treturn this.external_data;\n\t}\n\n\tonNextClick( e ) {\n\t\tif ( this.button_click_procesing == true ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif ( this.getStepObject().isRequiredButtonsClicked() == false ) { //On last step.\n\t\t\tvar $this = this;\n\t\t\tTAlertManager.showConfirmAlert( $.i18n._( '<strong>WARNING</strong>: You are about to proceed to the next step without performing all required actions! <br><br><strong>This may result in payments or reports not being submitted to this agency.</strong> <br><br>Are you sure you wish to continue?<br><br>' ), null, function( flag ) {\n\t\t\t\tif ( flag === true ) {\n\t\t\t\t\t//Log the fact that the user skipped a step.\n\t\t\t\t\tvar api_payroll_remittance_agency_event = TTAPI.APIPayrollRemittanceAgencyEvent;\n\t\t\t\t\tapi_payroll_remittance_agency_event.doLogWizardEvent( $this.getStepObject().getWizardObject().selected_remittance_agency_event_id, 'step', $this.getStepObject().current_step, 'skip', false, true, {\n\t\t\t\t\t\tonResult: function( result ) {\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\n\t\t\t\t\t$this.onNextClickComplete( e );\n\t\t\t\t}\n\t\t\t} );\n\t\t} else {\n\t\t\tif ( this.getStepObject().current_step == 'home' )