Below if the script you need to run if the top level Portfolio gets set to archived . If this happens and a user tries to login they will receive an error:
Check Out:Opens the check out page, which enables the user to specify the location on the client workstation where the checked-out document should be stored. View the latest version/View this version:When you view the latest version you will be viewing the most recent checked in copy that is in the Document Store. When you select to view this version you can choose a specific archived version of the document within the Document Store."