Uploaded image for project: 'OpenMRS Core'
  1. OpenMRS Core
  2. TRUNK-3646

Add ability to select/unselect all privileges on Role Management page

    XMLWordPrintable

    Details

    • Complexity:
      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

        Gliffy Diagrams

          Attachments

          1. select-all.patch
            2 kB
          2. TRUNK-3646.patch
            2 kB

            Activity

              People

              Assignee:
              channab Channa Bandara
              Reporter:
              mvorobey Mykola Vorobey
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 2 hours
                  2h
                  Remaining:
                  Time Spent - 45 minutes Remaining Estimate - 1 hour, 15 minutes
                  1h 15m
                  Logged:
                  Time Spent - 45 minutes Remaining Estimate - 1 hour, 15 minutes
                  45m