We have been asked by some of our clients to remove the “popups” menu, because they don’t see how and why some of its options might be useful to them and because they find its presence in the GUI distracting and even confusing.
But, when we tried to remove it, it caused an undesirable side-effect. Hiding it also removed vital information from the top bar: the patient’s name, his birth date and his age.
We’re still working to figure out how to hide this menu without causing other parts of the application’s functionality to go haywire. However, it’s things like these that make a code cleanup de riguer.
We managed to hide the “popups” menu without having the aforementioned side-effects. What’s displayed on the top bar, however, should be less dependent of customizations to the left-hand menu.
If you remove an element, you also have to remove/adjust any Javascript that references it. Otherwise a thread of execution encountering that code will abort and any subsequent actions in it will not happen.
While there are many arguments for code cleanup, this is not one of them.
The genPopupsList(); function had to become a comment in order to hide the “Popups” menu as follows:
//genPopupsList();
If in the left_nav.php, there is code function that affects main_title.php, this is a code design error.
And now, let’s go to the million dollar question: Is there a standard place where the Javascript code is in OpenEMR so that we’ll know if it references something we’re hiding or disabling? Or is the Javascript code all over the place, making even the most minute of fixes and customizations more difficult than necessary?
… you’ll notice it can be referenced by its name, “popups”. Then if you search for “popups” in that same module you’ll find this in the function syncRadios():
f.popups.disabled = (active_pid == 0);
… and it becomes obvious that this line of code will fail, causing anything that comes after it in the execution thread to fail.
Alternatively, you can turn on the error console in your browser and it will report this kind of error.
We set style=“visibility:hidden;” in line 230 where the HTML creates the select. We made it as follows:
<select style=“visibility:hidden;” name=‘popups’ onchange=‘selpopup(this)’ style=‘background-color:transparent;font-size:9pt;<?php echo $style;
?>’>