mirror of
https://github.com/openMF/community-app.git
synced 2026-02-06 13:17:04 +00:00
26 lines
1.0 KiB
JavaScript
26 lines
1.0 KiB
JavaScript
(function (module) {
|
|
mifosX.controllers = _.extend(module, {
|
|
CreateUserController: function (scope, resourceFactory, location) {
|
|
scope.offices = [];
|
|
scope.availableRoles = [];
|
|
resourceFactory.userTemplateResource.get(function (data) {
|
|
scope.offices = data.allowedOffices;
|
|
scope.availableRoles = data.availableRoles;
|
|
scope.formData = {
|
|
sendPasswordToEmail: true,
|
|
officeId: scope.offices[0].id,
|
|
};
|
|
});
|
|
|
|
scope.submit = function () {
|
|
resourceFactory.userListResource.save(this.formData, function (data) {
|
|
location.path('/viewuser/' + data.resourceId);
|
|
});
|
|
};
|
|
}
|
|
});
|
|
mifosX.ng.application.controller('CreateUserController', ['$scope', 'ResourceFactory', '$location', mifosX.controllers.CreateUserController]).run(function ($log) {
|
|
$log.info("CreateUserController initialized");
|
|
});
|
|
}(mifosX.controllers || {}));
|