SOS-1698 moving logic from main.js to view_messages.jspf because of LPS-34098 Disable PortletURLAction