Use the correct protocol for S3 attachment URLs based on the request security level

Problem: the generated URL for S3 attachments always uses the HTTP protocol. In the context of secure requests (made over HTTPS), the generated URL should use the HTTPS protocol instead.

Solution: Chosing the URL protocol during persistence of the attachment is not ideal because the attachment may be used in secured and unsecured contexts later. The correct protocol should be determined during the URL generation. This patch replaces the HTTP protocol and removes the port (:80) from the generated URL whenever the request is secure.
Fix the attachment URL only if the attachment is not proxied
Hide the images instead of the divs when showYearControls=NO so the calendar border remains intact. The previous behaviour created a visual glitch by removing the top corners of the calendar border.
Merge pull request #528 from hprange/bugfix/erattachment-s3-secure-url

Use the correct protocol for S3 attachment URLs based on the request security level
Merge pull request #529 from spelletier/fix_calendar_border_with_no_year_control

Hide the images instead of the divs when showYearControls=NO.