TimeTrex/interface/html5/dist/wizard-permission_wizard-PermissionWizardController.bundle.js

1 line
25 KiB
JavaScript
Raw Normal View History

2022-12-13 07:10:06 +01:00
"use strict";(self.webpackChunktimetrex=self.webpackChunktimetrex||[]).push([["wizard-permission_wizard-PermissionWizardController"],{1827:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"PermissionWizardController\": () => (/* binding */ PermissionWizardController)\n/* harmony export */ });\n/* provided dependency */ var _ = __webpack_require__(9050);\n/* provided dependency */ var $ = __webpack_require__(9755);\nclass PermissionWizardController extends BaseWizardController {\n\tconstructor( options = {} ) {\n\t\t_.defaults( options, {\n\t\t\tel: '.wizard-bg',\n\t\t\tapi_permission: null\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._( 'Permission Wizard' );\n\t\tthis.steps = 3;\n\t\tthis.current_step = 1;\n\n\t\tthis.render();\n\t}\n\n\trender() {\n\t\tsuper.render();\n\t\tthis.api_permission = TTAPI.APIPermission;\n\t\tthis.initCurrentStep();\n\t}\n\n\t//Create each page UI\n\tbuildCurrentStepUI() {\n\t\tvar $this = this;\n\t\tthis.content_div.empty();\n\n\t\tthis.stepsWidgetDic[this.current_step] = {};\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._( 'Choose role and permission actions' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\n\t\t\t\t//Role\n\t\t\t\tvar form_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tvar form_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tvar form_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar combobox = this.getComboBox( 'role', false );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Role' ) );\n\t\t\t\tform_item_input_div.append( combobox );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\t//Permission\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar permission = this.getAComboBox( null, true, 'global_option_column', 'permission', false, 'value' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Permissions' ) );\n\t\t\t\tform_item_input_div.append( permission );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tthis.stepsWidgetDic[this.current_step][combobox.getField()] = combobox;\n\t\t\t\tthis.stepsWidgetDic[this.current_step][permission.getField()] = permission;\n\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\n\t\t\t\tlabel = this.getLabel();\n\t\t\t\tlabel.text( $.i18n._( 'Choose modules and sub-modules' ) );\n\n\t\t\t\tthis.content_div.append( label );\n\n\t\t\t\t//Modules\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar modules = this.getAComboBox( null, true, 'global_option_column', 'section_group', false, 'value' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Modules' ) );\n\t\t\t\tform_item_input_div.append( modules );\n\n\t\t\t\tthis.content_div.append( form_item );\n\n\t\t\t\tform_item.bind( 'formItemChange', function( e, target ) {\n\t\t\t\t\tvar select_value = target.getValue();\n\t\t\t\t\t$this.setSection( select_value, true );\n\n\t\t\t\t} );\n\n\t\t\t\t//Sub Modules\n\t\t\t\tform_item = $( Global.loadWidget( 'global/widgets/wizard_form_item/WizardFormItem.html' ) );\n\t\t\t\tform_item_label = form_item.find( '.form-item-label' );\n\t\t\t\tform_item_input_div = form_item.find( '.form-item-input-div' );\n\n\t\t\t\tvar sub_modules = this.getAComboBox( null, true, 'global_option_column', 'section', false, 'value' );\n\n\t\t\t\tform_item_label.text( $.i18n._( 'Sub-Modules' ) );\n\t\t\t\tform_item_input_div.append( sub_modules );\n\n\t\t\t\tthis.content_div.appe