1 line
8.5 KiB
JavaScript
1 line
8.5 KiB
JavaScript
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-find_available-FindAvailableWizardController"],{6792:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"FindAvailableWizardController\": () => (/* binding */ FindAvailableWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass FindAvailableWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg'\n\t\t} );\n\n\t\tsuper( options );\n\t}\n\n\tinit( options ) {\n\t\t//this._super('initialize', options );\n\n\t\tthis.title = $.i18n._( 'Find available Employees' );\n\t\tthis.steps = 1;\n\t\tthis.current_step = 1;\n\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\n\t\tFindAvailableWizardController.type = this.default_data;\n\n\t\tthis.initCurrentStep();\n\t}\n\n\tbuildCurrentStepUI() {\n\n\t\tvar $this = this;\n\t\tthis.content_div.empty();\n\n\t\tthis.stepsWidgetDic[this.current_step] = {};\n\n\t\tswitch ( this.current_step ) {\n\t\t\tcase 1:\n\t\t\t\tvar label = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Pick one employee then click the green checkmark icon to assign the selected shift(s) to that employee' ) );\n\t\t\t\tthis.content_div.append( label );\n\n\t\t\t\tGlobal.loadViewSource( 'LoginUser', 'LoginUserView.css' );\n\n\t\t\t\tGlobal.loadViewSource( 'FindAvailable', 'FindAvailableViewController.js', function() {\n\n\t\t\t\t\tGlobal.loadViewSource( 'FindAvailable', 'FindAvailableView.html', function( result ) {\n\t\t\t\t\t\tvar args = {};\n\n\t\t\t\t\t\tvar template = _.template( result );\n\t\t\t\t\t\t$this.content_div.append( template( args ) );\n\n\t\t\t\t\t\tlet form_item_input = Global.loadWidgetByName( FormItemType.CHECKBOX );\n\t\t\t\t\t\tform_item_input.TCheckbox( { field: 'notify_user_schedule_change' } );\n\n\t\t\t\t\t\tlet widgetContainer = $( '<div class=\\'widget-h-box\\'></div>' );\n\t\t\t\t\t\tlet label = $( '<span class=\\'widget-right-label\\' style=\\'position: relative; top: 5px;\\'> ' + $.i18n._( 'Notify Employee' ) + '</span>' );\n\t\t\t\t\t\twidgetContainer.append( form_item_input );\n\t\t\t\t\t\twidgetContainer.append( label );\n\n\t\t\t\t\t\t$this.content_div.find( '#find_available_view_container' ).prepend( widgetContainer );\n\t\t\t\t\t\t$this.stepsWidgetDic[$this.current_step].notify_user_schedule_change = form_item_input;\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\t\tbreak;\n\n\t\t}\n\t}\n\n\tbuildCurrentStepData() {\n\t}\n\n\tonCloseClick() {\n\n\t\t$( this.el ).remove();\n\t\tLocalCacheData.current_open_wizard_controllers = LocalCacheData.current_open_wizard_controllers.filter( wizard => wizard.wizard_id !== this.wizard_id );\n\t\tLocalCacheData.extra_filter_for_next_open_view = null;\n\t}\n\n\tonDoneClick() {\n\n\t\tif ( find_available_view_controller.getGridSelectIdArray().length != 1 ) {\n\t\t\tTAlertManager.showAlert( $.i18n._( 'Choose one Employee' ) );\n\t\t\treturn;\n\t\t}\n\n\t\tthis.onCloseClick();\n\n\t\tlet notify_user_schedule_change = this.stepsWidgetDic[this.current_step].notify_user_schedule_change.getValue();\n\n\t\tif ( this.call_back ) {\n\t\t\tthis.call_back( find_available_view_controller.getGridSelectIdArray()[0], notify_user_schedule_change );\n\t\t}\n\t}\n\n}\n\nFindAvailableWizardController.type = '';//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiNjc5Mi5qcyIsIm1hcHBpbmdzIjoiOzs7Ozs7QUFBTztBQUNQLDJCQUEyQjtBQUMzQixFQUFFLENBQUM7QUFD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