MDL-45398 Manage availability restrictions: Show/hide not working

The show/hide icons were not working correctly. In addition, the
report still displayed even when availability feature was turned
off.

As well as fixing them, I added a Behat test to cover this report.