diff --git a/api/pom.xml b/api/pom.xml index 746c6423..575ba53b 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -28,33 +28,34 @@ - + org.openmrs.api openmrs-api + 2.2.0-alpha jar - + org.openmrs.web openmrs-web jar - + org.openmrs.api openmrs-api test-jar test - + org.openmrs.web openmrs-web test-jar test - + org.openmrs.test openmrs-test @@ -73,9 +74,9 @@ org.openmrs.module uiframework-api - + - + diff --git a/api/src/main/java/org/openmrs/module/adminui/account/Account.java b/api/src/main/java/org/openmrs/module/adminui/account/Account.java index 92880734..854865dc 100644 --- a/api/src/main/java/org/openmrs/module/adminui/account/Account.java +++ b/api/src/main/java/org/openmrs/module/adminui/account/Account.java @@ -34,15 +34,15 @@ import org.openmrs.PersonAttribute; public class Account { - + private Person person; - + private List userAccounts; - + private List providerAccounts; - + private Map userPasswordMap = new HashMap(); - + public Account(Person person) { this.person = person; if (getPerson().getPersonId() != null) { @@ -56,28 +56,28 @@ public Account(Person person) { } } } - + public Person getPerson() { if (person == null) { person = new Person(); } return person; } - + public List getUserAccounts() { if (userAccounts == null) { userAccounts = new ArrayList(); } return userAccounts; } - + public List getProviderAccounts() { if (providerAccounts == null) { providerAccounts = new ArrayList(); } return providerAccounts; } - + public void addUserAccount(User user) { if (user.getPerson() == null) { user.setPerson(getPerson()); @@ -88,7 +88,7 @@ public void addUserAccount(User user) { } getUserAccounts().add(user); } - + public void addProviderAccount(Provider provider) { if (provider.getPerson() == null) { provider.setPerson(getPerson()); @@ -99,35 +99,35 @@ public void addProviderAccount(Provider provider) { } getProviderAccounts().add(provider); } - + private void initializePersonNameIfNecessary() { if (getPerson().getPersonName() == null) { getPerson().addName(new PersonName()); } } - + public void setGivenName(String givenName) { initializePersonNameIfNecessary(); getPerson().getPersonName().setGivenName(givenName); } - + public String getGivenName() { return getPerson().getGivenName(); } - + public void setFamilyName(String familyName) { initializePersonNameIfNecessary(); getPerson().getPersonName().setFamilyName(familyName); } - + public String getFamilyName() { return getPerson().getFamilyName(); } - + public void setGender(String gender) { getPerson().setGender(gender); } - + public String getGender() { return getPerson().getGender(); } @@ -156,7 +156,7 @@ public Role getPrivilegeLevel(User user) { } return null; } - + public Set getCapabilities(User user) { Set capabilities = new HashSet(); if (user != null && user.getRoles() != null) { @@ -168,19 +168,19 @@ public Set getCapabilities(User user) { } return capabilities; } - + public User getCreator() { return getPerson().getCreator(); } - + public Date getDateCreated() { return getPerson().getDateCreated(); } - + /** * Gets changedBy value for the most recently edited entity of the account i.e the person, * providers and user accounts - * + * * @return the most recent changedBy value * @should return the most recent changedBy value */ @@ -188,10 +188,10 @@ public User getChangedBy() { if (getSortedAuditables().isEmpty()) { return null; } - + return getSortedAuditables().get(0).getChangedBy(); } - + /** * Get dateChanged value for the most recently edited entity of the account i.e the person, * providers and user accounts @@ -203,23 +203,23 @@ public Date getDateChanged() { if (getSortedAuditables().isEmpty()) { return null; } - + return getSortedAuditables().get(0).getDateChanged(); - + } - + public boolean isSupposedToChangePassword(User user) { return new UserProperties(user.getUserProperties()).isSupposedToChangePassword(); } - + public String getPassword(User user) { return userPasswordMap.get(user); } - + public String setPassword(User user, String password) { return userPasswordMap.put(user, password); } - + private List getSortedAuditables() { List auditables = new ArrayList(); auditables.add(getPerson()); @@ -231,7 +231,7 @@ private List getSortedAuditables() { auditables.addAll(getUserAccounts()); auditables.addAll(getProviderAccounts()); Collections.sort(auditables, Collections.reverseOrder(new Comparator() { - + @Override public int compare(Auditable a1, Auditable a2) { Date date1 = (a1 != null) ? a1.getDateChanged() : null; @@ -239,9 +239,9 @@ public int compare(Auditable a1, Auditable a2) { return OpenmrsUtil.compareWithNullAsEarliest(date1, date2); } })); - + return auditables; - + } - + } diff --git a/api/src/main/java/org/openmrs/module/adminui/account/AccountServiceImpl.java b/api/src/main/java/org/openmrs/module/adminui/account/AccountServiceImpl.java index 36a53d5e..492a3b8f 100644 --- a/api/src/main/java/org/openmrs/module/adminui/account/AccountServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/adminui/account/AccountServiceImpl.java @@ -31,43 +31,43 @@ @Transactional public class AccountServiceImpl extends BaseOpenmrsService implements AccountService { - + private UserService userService; - + private PersonService personService; - + private ProviderService providerService; - + private AdministrationService adminService; - + /** * @param userService the userService to set */ public void setUserService(UserService userService) { this.userService = userService; } - + /** * @param providerService */ public void setProviderService(ProviderService providerService) { this.providerService = providerService; } - + /** * @param personService the personService to set */ public void setPersonService(PersonService personService) { this.personService = personService; } - + /** * @param adminService the adminService to set */ public void setAdminService(AdministrationService adminService) { this.adminService = adminService; } - + /** * @see AccountService#saveAccount(Account) */ @@ -84,7 +84,7 @@ public void saveAccount(Account account) { } else { try { - userService.saveUser(user, null); + userService.saveUser(user); } catch (NoSuchMethodError ex) { try { @@ -99,19 +99,19 @@ public void saveAccount(Account account) { } } } - + @Override @Transactional(readOnly = true) public List getAllAccounts() { - + Map personAccountMap = new LinkedHashMap(); - + for (User user : userService.getAllUsers()) { //exclude daemon user if (AdminUiConstants.DAEMON_USER_UUID.equals(user.getUuid())) { continue; } - + Person person = user.getPerson(); Account account = personAccountMap.get(person); if (account == null) { @@ -122,7 +122,7 @@ public List getAllAccounts() { account.addUserAccount(user); } } - + List unknownProviders = new ArrayList(); String unknownProviderUuid = adminService.getGlobalProperty("emr.unknownProvider"); if (StringUtils.isNotBlank(unknownProviderUuid)) { @@ -137,7 +137,7 @@ public List getAllAccounts() { if (unknownProviders.contains(provider)) { continue; } - + Person person = provider.getPerson(); if (person == null) { person = new Person(); @@ -154,13 +154,13 @@ public List getAllAccounts() { account.getProviderAccounts().add(provider); } } - + List accounts = new ArrayList(); accounts.addAll(personAccountMap.values()); - + return accounts; } - + /** * @see org.openmrs.module.adminui.account.AccountService#getAllCapabilities() */ @@ -174,7 +174,7 @@ public List getAllCapabilities() { } return capabilities; } - + /** * @see org.openmrs.module.adminui.account.AccountService#getAllPrivilegeLevels() */ @@ -188,5 +188,5 @@ public List getAllPrivilegeLevels() { } return privilegeLevels; } - + } diff --git a/api/src/main/resources/messages.properties b/api/src/main/resources/messages.properties index 8f21ed23..88c7f1a6 100644 --- a/api/src/main/resources/messages.properties +++ b/api/src/main/resources/messages.properties @@ -131,6 +131,7 @@ adminui.gender=Gender adminui.user.account.details=User Account Details adminui.user.enabled=User Enabled adminui.user.username=Username +adminui.user.email=Email adminui.user.password=Password adminui.user.duplicateUsername=Duplicate UserName adminui.account.passwordFormat=Password Format diff --git a/omod/pom.xml b/omod/pom.xml index acd5af2c..2257b656 100644 --- a/omod/pom.xml +++ b/omod/pom.xml @@ -34,32 +34,32 @@ - - + - + ${project.parent.groupId} ${project.parent.artifactId}-api ${project.parent.version} - - + + - + org.openmrs.api openmrs-api - jar + 2.2.0-alpha @@ -67,7 +67,7 @@ openmrs-web jar - + org.openmrs.api openmrs-api @@ -88,13 +88,13 @@ pom test - + org.openmrs.module appframework-api jar - + org.openmrs.module uiframework-api @@ -127,7 +127,7 @@ ${appuiVersion} provided - + @@ -145,7 +145,7 @@ gem provided - + @@ -188,7 +188,7 @@ true - org.eclipse.m2e diff --git a/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangeDefaultsPageController.java b/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangeDefaultsPageController.java index b0214ea6..0f9aa6ad 100644 --- a/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangeDefaultsPageController.java +++ b/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangeDefaultsPageController.java @@ -57,7 +57,7 @@ public String post(PageModel model, @MethodParam("getUserDefaults") @BindParams props.put(OpenmrsConstants.USER_PROPERTY_PROFICIENT_LOCALES, userDefaults.getProficientLocales()); user.setUserProperties(props); try { - userService.saveUser(user, null); + userService.saveUser(user); } catch (NoSuchMethodError ex) { //must be running platforms 2.0 and above which do not have the above method @@ -80,10 +80,10 @@ public String post(PageModel model, @MethodParam("getUserDefaults") @BindParams } return "redirect:" + ui.pageLink("adminui", "myaccount/myAccount"); } - + public UserDefaults getUserDefaults(@RequestParam(value = "defaultLocale", required = false) String defaultLocale, @RequestParam(value = "proficientLocales", required = false) String proficientLocales) { - + return new UserDefaults(defaultLocale, proficientLocales); } diff --git a/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangePasswordPageController.java b/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangePasswordPageController.java index ae6a2b5d..8da8aec2 100644 --- a/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangePasswordPageController.java +++ b/omod/src/main/java/org/openmrs/module/adminui/page/controller/myaccount/ChangePasswordPageController.java @@ -35,49 +35,49 @@ import org.springframework.web.bind.annotation.RequestParam; public class ChangePasswordPageController { - + protected final Log log = LogFactory.getLog(getClass()); - + @RequestMapping(method = RequestMethod.GET) public String overrideGetChangePasswordPage() { return "forward:/adminui/myaccount/changePassword.page"; } - + @RequestMapping(method = RequestMethod.POST) public String overridePostChangePassword() { return "forward:/adminui/myaccount/changePassword.page"; } - + public void get(PageModel model, @SpringBean("adminService") AdministrationService adminService) { setModelAttributes(model, adminService); } - + public void setModelAttributes(PageModel model, AdministrationService adminService) { model.addAttribute("passwordMinLength", adminService.getGlobalProperty(OpenmrsConstants.GP_PASSWORD_MINIMUM_LENGTH, "8")); } - + public String post(PageModel model, @SpringBean("userService") UserService userService, @RequestParam("oldPassword") String oldPassword, @RequestParam("newPassword") String newPassword, @RequestParam("confirmPassword") String confirmPassword, @SpringBean("adminService") AdministrationService adminService, @SpringBean("messageSourceService") MessageSourceService mss, HttpServletRequest request) { - + User user = Context.getAuthenticatedUser(); String errorMessage = null; if (StringUtils.isBlank(oldPassword) || StringUtils.isBlank(newPassword) || StringUtils.isBlank(confirmPassword)) { errorMessage = "adminui.missing.requiredFields"; } - + if (StringUtils.isNotBlank(newPassword) && StringUtils.isNotBlank(confirmPassword) && !newPassword.equals(confirmPassword)) { errorMessage = "adminui.account.changePassword.newAndConfirmPassword.dontMatch"; } - + if (errorMessage == null) { try { OpenmrsUtil.validatePassword(user.getUsername(), newPassword, user.getSystemId()); - + String nextPage = "redirect:/index.htm"; try { userService.changePassword(oldPassword, newPassword); @@ -95,7 +95,7 @@ public String post(PageModel model, @SpringBean("userService") UserService userS userProperties = new UserProperties(user.getUserProperties()); userProperties.setSupposedToChangePassword(false); try { - userService.saveUser(user, null); + userService.saveUser(user); } catch (NoSuchMethodError ex) { //must be running platforms 2.0 and above which do not have the above method @@ -110,12 +110,12 @@ public String post(PageModel model, @SpringBean("userService") UserService userS } else { nextPage = "myaccount/myAccount"; } - + InfoErrorMessageUtil .flashInfoMessage(request.getSession(), mss.getMessage("adminui.changePassword.success")); - + Context.refreshAuthenticatedUser(); - + return nextPage; } catch (PasswordException e) { @@ -125,15 +125,15 @@ public String post(PageModel model, @SpringBean("userService") UserService userS log.error("Failed to change user password:", e); } } - + if (errorMessage == null) { errorMessage = "adminui.account.changePassword.fail"; } - + request.getSession().setAttribute(UiCommonsConstants.SESSION_ATTRIBUTE_ERROR_MESSAGE, errorMessage); - + setModelAttributes(model, adminService); - + return "myaccount/changePassword"; } } diff --git a/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java b/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java index 610b3796..b9090bf9 100644 --- a/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java +++ b/omod/src/main/java/org/openmrs/module/adminui/page/controller/systemadmin/accounts/AccountPageController.java @@ -60,13 +60,13 @@ * This controller only handles requests to create a new account and doesn't support editing */ public class AccountPageController { - + protected final Log log = LogFactory.getLog(getClass()); - + public Account getAccount(@RequestParam(value = "personId", required = false) Person person) { - + Account account; - + if (person == null) { account = new Account(new Person()); } else { @@ -75,10 +75,10 @@ public Account getAccount(@RequestParam(value = "personId", required = false) Pe throw new APIException("Failed to find user account matching person with id:" + person.getPersonId()); } } - + return account; } - + /** * @param model * @param account @@ -92,13 +92,13 @@ public void get(PageModel model, @MethodParam("getAccount") Account account, UiUtils uu, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService) throws IOException { - + setModelAttributes(model, account, null, accountService, administrationService, providerManagementService, uu, appFrameworkService); if (account.getPerson().getPersonId() == null) { setJsonFormData(model, account, null); } } - + /** * @param account * @param messageSourceService @@ -119,7 +119,6 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou @SpringBean("providerManagementService") ProviderManagementService providerManagementService, @SpringBean("appFrameworkService") AppFrameworkService appFrameworkService, HttpServletRequest request, UiUtils uu) throws IOException { - Errors errors = new BeanPropertyBindingResult(account, "account"); List customUserPropertyEditFragments = @@ -128,7 +127,7 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou for(Extension ext : customUserPropertyEditFragments) { if (StringUtils.equals(ext.getExtensionParams().get("type").toString(), "userProperty")) { String userPropertyName = ext.getExtensionParams().get("userPropertyName").toString(); - String[] parameterValues = parameterMap.get(userPropertyName); + String[] parameterValues = parameterMap.get(userPropertyName); if (parameterValues != null && parameterValues.length > 0) { String parameterValue; if (userPropertyName == "locationUuid") { @@ -180,7 +179,7 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou user.addRole(userService.getRoleByUuid(uuid)); } } - + String forcePassword = otherAccountData.getForceChangePassword() ? "true" : "false"; user.setUserProperty(OpenmrsConstants.USER_PROPERTY_CHANGE_PASSWORD, forcePassword); account.addUserAccount(user); @@ -191,9 +190,9 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou provider.setProviderRole(providerManagementService.getProviderRoleByUuid(request.getParameter("providerRole"))); account.addProviderAccount(provider); } - + accountValidator.validate(account, errors); - + if (!errors.hasErrors()) { try { account.setPassword(user, otherAccountData.getPassword()); @@ -215,20 +214,20 @@ public String post(PageModel model, @MethodParam("getAccount") @BindParams Accou } } } - + setModelAttributes(model, account, otherAccountData, accountService, administrationService, providerManagementService, uu, appFrameworkService); - + sendErrorMessage(errors, model, messageSourceService, request); - + if (account.getPerson().getPersonId() == null) { setJsonFormData(model, account, otherAccountData); } - + return "systemadmin/accounts/account"; - + } - + public void setModelAttributes(PageModel model, Account account, OtherAccountData otherAccountData, AccountService accountService, AdministrationService administrationService, ProviderManagementService providerManagementService, UiUtils uu, @@ -248,7 +247,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat //had previously selected forcePasswordChange = otherAccountData.getForceChangePassword(); } - + model.addAttribute("otherAccountData", otherAccountData); List capabilities = accountService.getAllCapabilities(); model.addAttribute("capabilities", accountService.getAllCapabilities()); @@ -291,7 +290,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat model.addAttribute("propertyMaxLengthMap", propertyMaxLengthMap); model.addAttribute("passwordMinLength", administrationService.getGlobalProperty(OpenmrsConstants.GP_PASSWORD_MINIMUM_LENGTH, "8")); - + ObjectMapper mapper = new ObjectMapper(); SimpleObject so = new SimpleObject(); for (Role cap : capabilities) { @@ -305,7 +304,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat so.put(role.getUuid(), str.substring(str.indexOf(privilegeLevelPrefix) + privilegeLevelPrefix.length())); } model.addAttribute("privilegeLevelsJson", mapper.writeValueAsString(so)); - + if (account.getPerson().getPersonId() != null) { account.getProviderAccounts().add(new Provider()); account.getUserAccounts().add(new User()); @@ -315,6 +314,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat SimpleObject simpleUser = new SimpleObject(); simpleUser.put("username", user.getUsername()); simpleUser.put("systemId", user.getSystemId()); + simpleUser.put("email", user.getEmail()); simpleUser.put("privilegeLevel", account.getPrivilegeLevel(user) != null ? account.getPrivilegeLevel(user) .getUuid() : ""); SimpleObject userProperties = new SimpleObject(); @@ -334,24 +334,24 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat } simpleUser.put("userProperties", userProperties); simpleUser.put("retired", user.getRetired()); - + SimpleObject simpleUserCapabilities = new SimpleObject(); Set userCapabilities = account.getCapabilities(user); for (Role cap : capabilities) { simpleUserCapabilities.put(cap.getUuid(), userCapabilities.contains(cap)); } simpleUser.put("capabilities", simpleUserCapabilities); - + so.put(user.getUuid(), simpleUser); } model.addAttribute("uuidAndUserMapJson", mapper.writeValueAsString(so)); - + so = new SimpleObject(); for (ProviderRole pr : providerRoles) { so.put(pr.getUuid(), uu.format(pr)); } model.addAttribute("providerRolesJson", mapper.writeValueAsString(so)); - + so = new SimpleObject(); for (OpenmrsObject o : account.getProviderAccounts()) { Provider p = (Provider) o; @@ -360,11 +360,11 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat simpleProvider.put("identifier", p.getIdentifier()); simpleProvider.put("providerRole", (p.getProviderRole() != null) ? p.getProviderRole().getUuid() : ""); simpleProvider.put("retired", p.isRetired()); - + so.put(p.getUuid(), simpleProvider); } model.addAttribute("uuidAndProviderJson", mapper.writeValueAsString(so)); - + so = new SimpleObject(); so.put("savedChanges", uu.message("adminui.savedChanges")); so.put("saved", uu.message("adminui.saved")); @@ -396,7 +396,7 @@ public void setModelAttributes(PageModel model, Account account, OtherAccountDat model.addAttribute("messages", mapper.writeValueAsString(so)); } - + private void sendErrorMessage(Errors errors, PageModel model, MessageSourceService mss, HttpServletRequest request) { model.addAttribute("errors", errors); StringBuffer errorMessage = new StringBuffer(mss.getMessage("error.failed.validation")); @@ -409,22 +409,23 @@ private void sendErrorMessage(Errors errors, PageModel model, MessageSourceServi errorMessage.append(""); request.getSession().setAttribute(UiCommonsConstants.SESSION_ATTRIBUTE_ERROR_MESSAGE, errorMessage.toString()); } - + private void setJsonFormData(PageModel model, Account account, OtherAccountData otherAccountData) throws IOException { - + ObjectMapper mapper = new ObjectMapper(); SimpleObject simplePerson = new SimpleObject(); simplePerson.put("familyName", account.getFamilyName()); simplePerson.put("givenName", account.getGivenName()); simplePerson.put("gender", account.getGender() != null ? account.getGender() : ""); model.addAttribute("personJson", mapper.writeValueAsString(simplePerson)); - + SimpleObject simpleUser = new SimpleObject(); SimpleObject simpleProvider = new SimpleObject(); if (otherAccountData != null) { if (otherAccountData.getAddUserAccount()) { User u = account.getUserAccounts().get(0); simpleUser.put("username", u.getUsername()); + simpleUser.put("email", u.getEmail()); simpleUser.put("privilegeLevel", account.getPrivilegeLevel(u).getUuid()); SimpleObject userProperties = new SimpleObject(); userProperties @@ -436,16 +437,16 @@ private void setJsonFormData(PageModel model, Account account, OtherAccountData } simpleUser.put("capabilities", simpleUserCapabilities); } - + if (otherAccountData.getAddProviderAccount()) { Provider prov = (Provider) account.getProviderAccounts().get(0); simpleProvider.put("identifier", prov.getIdentifier()); simpleProvider.put("providerRole", prov.getProviderRole().getUuid()); } } - + model.addAttribute("userJson", mapper.writeValueAsString(simpleUser)); model.addAttribute("providerJson", mapper.writeValueAsString(simpleProvider)); } - + } diff --git a/omod/src/main/webapp/fragments/systemadmin/accounts/userFormFields.gsp b/omod/src/main/webapp/fragments/systemadmin/accounts/userFormFields.gsp index 91b6aff9..c7b272bc 100644 --- a/omod/src/main/webapp/fragments/systemadmin/accounts/userFormFields.gsp +++ b/omod/src/main/webapp/fragments/systemadmin/accounts/userFormFields.gsp @@ -1,6 +1,7 @@ <% def userUuid = '' def username = '' + def email = '' def privilegeLevelUuid = '' def user = null; def showPasswordFields = false @@ -11,6 +12,7 @@ user = config.user userUuid = user.uuid username = user.username ?: '' + email = user.email ?: '' changePassword = account.isSupposedToChangePassword(user) if(account.getPrivilegeLevel(user)){ privilegeLevelUuid = account.getPrivilegeLevel(user).uuid @@ -34,6 +36,9 @@ "ng-maxlength": propertyMaxLengthMap['username']] usernameAttributes[requiredAttribute] = requiredAttributeValue; + def userEmailAttributes = ["ng-model": "uuidUserMap['"+userUuid+"'].email"] + userEmailAttributes[requiredAttribute] = requiredAttributeValue; + def privilegeLevelAttributes = ["ng-model": "uuidUserMap['"+userUuid+"'].privilegeLevel"] privilegeLevelAttributes[requiredAttribute] = requiredAttributeValue @@ -67,6 +72,21 @@ + + ${ ui.includeFragment("uicommons", "field/text", [ + label: ui.message("adminui.user.email")+"*", + id: "adminui-email"+userUuid, + formFieldName: "email"+userUuid, + initialValue: email, + otherAttributes: userEmailAttributes + ]) } + + + ${ui.message("adminui.field.required")} + + + ${ ui.includeFragment("uicommons", "field/dropDown", [ label: ui.message("adminui.account.privilegeLevel")+"*", diff --git a/omod/src/main/webapp/fragments/systemadmin/accounts/userTabContentPane.gsp b/omod/src/main/webapp/fragments/systemadmin/accounts/userTabContentPane.gsp index 947f123b..a2e8f86f 100644 --- a/omod/src/main/webapp/fragments/systemadmin/accounts/userTabContentPane.gsp +++ b/omod/src/main/webapp/fragments/systemadmin/accounts/userTabContentPane.gsp @@ -17,6 +17,12 @@ {{uuidUserMap['${uuid}'].username}} + + ${ui.message("adminui.user.email")} + + {{uuidUserMap['${uuid}'].email}} + + ${ui.message("adminui.account.privilegeLevel")} @@ -68,6 +74,7 @@ ng-click="save('${uuid}'<% if(!user.userId) { %>, '${account.person.uuid}'<% } %>)" ng-disabled="userDetailsForm['username${uuid}'].\$invalid || userDetailsForm['privilegeLevel${uuid}'].\$invalid + || userDetailsForm['email${uuid}'].\$invalid || userDetailsForm['password${uuid}'].\$invalid || userDetailsForm['confirmPassword${uuid}'].\$invalid || requesting"> ${ ui.message("general.save") } diff --git a/omod/src/main/webapp/resources/scripts/fragments/systemadmin/userDetails.js b/omod/src/main/webapp/resources/scripts/fragments/systemadmin/userDetails.js index 6c6def89..3ebc3de9 100644 --- a/omod/src/main/webapp/resources/scripts/fragments/systemadmin/userDetails.js +++ b/omod/src/main/webapp/resources/scripts/fragments/systemadmin/userDetails.js @@ -146,9 +146,10 @@ angular.module("adminui.userDetails", ["userService", "ngDialog", "adminui.shoul } } }); - + var toSave = { username: modelUser.username, + email: modelUser.email, roles: privilegesLevelAndCapabilities, userProperties: uProperties }; diff --git a/pom.xml b/pom.xml index 55792411..fc955a2a 100644 --- a/pom.xml +++ b/pom.xml @@ -21,7 +21,7 @@ Admin UI Module Administration Tools for the Reference Application https://wiki.openmrs.org/x/NJO-B - + Ujjwal Arora @@ -30,7 +30,7 @@ OpenMRS Developers - + OpenMRS http://openmrs.org @@ -47,7 +47,7 @@ api omod - + 1.11.4 UTF-8 @@ -63,11 +63,11 @@ - + org.openmrs.api openmrs-api - ${openMRSVersion} + 2.2.0-alpha jar provided @@ -79,15 +79,15 @@ jar provided - + org.openmrs.api openmrs-api - ${openMRSVersion} + 2.2.0-alpha test-jar test - + org.openmrs.web openmrs-web @@ -95,7 +95,7 @@ test-jar test - + org.openmrs.test openmrs-test @@ -103,11 +103,11 @@ pom test - + - - - + + + org.openmrs.module appframework-api @@ -115,7 +115,7 @@ jar provided - + org.openmrs.module appframework-api @@ -131,7 +131,7 @@ jar provided - + org.openmrs.module @@ -190,12 +190,12 @@ 3.0 -This Source Code Form is subject to the terms of the Mozilla Public License, -v. 2.0. If a copy of the MPL was not distributed with this file, You can -obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under +This Source Code Form is subject to the terms of the Mozilla Public License, +v. 2.0. If a copy of the MPL was not distributed with this file, You can +obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under the terms of the Healthcare Disclaimer located at http://openmrs.org/license. -Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS +Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS graphic logo is a trademark of OpenMRS Inc.