partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

StockConfiguration.js (1163B)


      1 Ext.define('PartKeepr.Components.UserPreferences.Preferences.StockConfiguration', {
      2     extend: 'PartKeepr.Components.Preferences.PreferenceEditor',
      3 
      4     initComponent: function ()
      5     {
      6         this.confirmInlineStockLevelChangesCheckbox = Ext.create("Ext.form.field.Checkbox", {
      7                 boxLabel: i18n("Confirm in-line stock level changes from the parts grid")
      8             });
      9 
     10             if (PartKeepr.getApplication().getUserPreference("partkeepr.inline-stock-change.confirm", true) === false) {
     11     			this.confirmInlineStockLevelChangesCheckbox.setValue(false);
     12     		} else {
     13     			this.confirmInlineStockLevelChangesCheckbox.setValue(true);
     14     		}
     15 
     16             this.items = [ this.confirmInlineStockLevelChangesCheckbox ];
     17 
     18             this.callParent();
     19     },
     20     onSave: function ()
     21     {
     22         PartKeepr.getApplication().setUserPreference("partkeepr.inline-stock-change.confirm", 
     23         this.confirmInlineStockLevelChangesCheckbox.getValue());
     24     },
     25     statics: {
     26         iconCls: 'web-icon brick',
     27         title: i18n('Stock'),
     28         menuPath: [{iconCls: 'fugue-icon ui-scroll-pane-image', text: i18n("User Interface")}]
     29     }
     30 });