commit 5cc25f731ed03cd2aa9ff54d9b52db67b05f294f
parent 8515ab6badde0c5dd408b52c0fffb2d8e60baec5
Author: Felicitus <felicitus@felicitus.org>
Date: Wed, 9 Dec 2015 15:56:48 +0100
Set active flag to true for new records
Diffstat:
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js b/src/PartKeepr/FrontendBundle/Resources/public/js/Components/User/UserEditor.js
@@ -26,7 +26,8 @@ Ext.define('PartKeepr.UserEditor', {
xtype: 'displayfield',
itemId: 'legacyField',
fieldLabel: i18n("Legacy User"),
- value: i18n('This user is a legacy user. You must provide a password in order to change the user. Please read <a href="https://wiki.partkeepr.org/wiki/Authentication" target="_blank">the PartKeepr Wiki regarding Authentication</a> for further information.'),
+ value: i18n(
+ 'This user is a legacy user. You must provide a password in order to change the user. Please read <a href="https://wiki.partkeepr.org/wiki/Authentication" target="_blank">the PartKeepr Wiki regarding Authentication</a> for further information.'),
hidden: true
}, {
xtype: 'checkbox',
@@ -42,12 +43,20 @@ Ext.define('PartKeepr.UserEditor', {
},
toggleLegacyField: function ()
{
- if (this.record.getProvider().get("type") === "Builtin" && this.record.get("legacy") === false) {
+ var isBuiltInProvider = this.record.getProvider() !== null &&
+ this.record.getProvider().get("type") === "Builtin" &&
+ this.record.get("legacy") === false;
+
+ if (isBuiltInProvider || this.record.phantom === true) {
this.down("#activeCheckbox").setVisible(true);
} else {
this.down("#activeCheckbox").setVisible(false);
}
+ if (this.record.phantom) {
+ this.down("#activeCheckbox").setValue(true);
+ }
+
if (this.record.get("legacy") === true) {
this.down("#legacyField").setVisible(true);
} else {