Skip to content

Commit

Permalink
Merge pull request #363 from mozzy11/fix_bug2
Browse files Browse the repository at this point in the history
fix slecting lab unit roles
  • Loading branch information
mozzy11 authored Jul 10, 2022
2 parents c09ff4d + 4a9b770 commit 1810399
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions src/main/resources/languages/message_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7689,6 +7689,7 @@ systemuserrole.newpermissions = Add New Permissons
systemuserrole.allLabUnits = All Lab Units
systemuserrole.copypermisions = Copy Permisions From User
systemuserrole.apply = Apply
systemuserrole.select.allLabUnits.warning = Selecting All Lab Units will Overide other Lab Unit Permisions
systemuserrole.instruction = <h3> Roles </h3> \
There are two types of Roles. Global Roles which are set for the entire application and Lab Unit Roles which can be set for all Lab Units or specific Lab Units. <br>\
<br>\
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/languages/message_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7197,6 +7197,7 @@ systemuserrole.allLabUnits = Toutes les unités de laboratoire
systemuserrole.copypermisions = Copier les autorisations de l'utilisateur
systemuserrole.apply = Appliquer
systemuserrole.warning.replace = Avertissement! Toutes les autorisations actuelles seront remplacées !
systemuserrole.select.allLabUnits.warning = La sélection de toutes les unités de laboratoire remplacera les autres autorisations d'unité de laboratoire
systemuserrole.instruction = <h3> Rôles </h3> \
Il existe deux types de rôles. Rôles globaux qui sont définis pour l'ensemble de l'application et rôles d'unité de laboratoire qui peuvent être définis pour toutes les unités de laboratoire ou des unités <br>\
de laboratoire spécifiques. <br>\
Expand Down
18 changes: 7 additions & 11 deletions src/main/webapp/pages/systemuser/unifiedSystemUser.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,14 @@ function mySaveAction() {
};
function disableAddRoles() {
var rolesSection = document.getElementById("rolesRow");
var tables = rolesSection.getElementsByTagName("table");
var allLabSelected = false;
for (var y = 1; y < tables.length; y++) {
var allLabUnitsOption = tables[y].rows[0].cells[1].getElementsByTagName("option")[0];
if (allLabUnitsOption.selected == true) {
allLabSelected = true;
}
}
if (allLabSelected) {
var rolesTable1 = document.getElementById("rolesTable_1");
var selectedLabUnit = rolesTable1.rows[0].cells[1].getElementsByTagName("select")[0];
var value = selectedLabUnit.options[selectedLabUnit.selectedIndex].value;
console.log(value);
if (value == "1=AllLabUnits") {
alert("<spring:message code="systemuserrole.select.allLabUnits.warning"/>");
document.getElementById("createNewRoles").disabled = true;
} else {
}else {
document.getElementById("createNewRoles").disabled = false;
}
}
Expand Down

0 comments on commit 1810399

Please sign in to comment.