Details
-
New Feature
-
Status: Closed
-
Should
-
Resolution: Fixed
-
OpenMRS 1.9.0
-
None
-
Low
Description
It is a bit inconvenient if you need, for example, to create a role with almost all privileges, but omitting ones for managing user. In this case you need mouse click on each privilege you desire to enable for some role. Instead of doing this burdensome selection you may toggle feature to select them all and then unselect restricted privileges. So, it is need to add toggling checkbox right above the table with privileges on Role Management page.
You may consider using jQuery for this. Lets assume that you've added this snapshot into your jsp page for managing role:
<input type="checkbox" id="toggleSelectionCheckbox">Select/unselect All
Then all that you need is just to bind simple javascript handler to click event on that checkbox like follows:
jQuery("#toggleSelectionCheckbox").click(function(e) { jQuery("input[type='checkbox'][name='privileges']").each(function() { jQuery(this).attr("checked", jQuery("#toggleSelectionCheckbox").attr("checked")); }) });
File to consider for this is: roleForm.jsp