Display Object Id when View button is displayed.

DSC-1025

Moved status check into a freemarker function.
Moved Object Id conditional higher in the code so that the values created can be re-used.