Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
feature(Courses): password dlg on password reset
Browse files Browse the repository at this point in the history
  • Loading branch information
corneliusweiss committed Jul 26, 2021
1 parent c5799fd commit ee92478
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 17 deletions.
36 changes: 19 additions & 17 deletions tine20/Courses/js/CourseEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -336,24 +336,9 @@ Tine.Courses.CourseEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
});

const action_resetPwd = new Ext.Action({
text: i18n._('Reset Password'),
text: this.app.i18n._('Reset Password'),
scope: this,
handler: function(_button, _event) {
this.loadMask.show();
var accountObject = this.membersGrid.getSelectionModel().getSelected().data;
Ext.Ajax.request( {
params : {
method : 'Courses.resetPassword',
account : accountObject.id,
password : this.record.data.name,
mustChange: true
},
scope: this,
success: function() {
this.hideLoadMask();
}
});
},
handler: this.onResetPassword,
iconCls: 'action_password'
});

Expand All @@ -366,6 +351,23 @@ Tine.Courses.CourseEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
}
return this.membersGrid;
},

onResetPassword() {
const passwordDialog = new Tine.Tinebase.widgets.dialog.PasswordDialog({
allowEmptyPassword: false,
locked: false,
questionText: i18n._('Please enter the new Password.')
});
passwordDialog.openWindow();

passwordDialog.on('apply', function (password) {
this.loadMask.show();
const accountObject = this.membersGrid.getSelectionModel().getSelected().data;
Tine.Courses.resetPassword(accountObject.id, password, true).finally(() => {
this.hideLoadMask();
});
}, this);
}
});

/**
Expand Down
3 changes: 3 additions & 0 deletions tine20/Courses/translations/de.po
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ msgstr "unbekannt"
msgid "Reset Password"
msgstr "Passwort zurücksetzen"

msgid "Please enter the new Password."
msgstr "Bitte geben sie das neue Password ein."

#: js/CourseGridPanel.js:44 js/Models.js:68
msgid "Name"
msgstr "Name"
Expand Down

0 comments on commit ee92478

Please sign in to comment.