# Notices and software-release announcements

## Update

Apply `database/migrations/20261016_notices.sql` before opening this update. Copy the updated source files while preserving your live environment configuration and private project uploads. Hard refresh with Ctrl+F5. Fresh installations include the new tables in the full schema.

## Publish

Administrators and HODs can open Notices and choose Publish notice. Choose Announcement or Software release, enter the title and message, and select Global (all campuses) or one or more selected campuses. The campus checklist is searchable and retains selections during a search. Both administrators and HODs can use the requested global/campus audiences. Campus delivery follows the recipient account’s current campus assignment. Publishers can also see their own publications.

Software releases include software name, release version, release notes, an optional resource/download link and normal/important priority. The form includes a live title/message preview and a clear audience summary. This feature announces releases and links to resources; it does not upload software binaries. Publishing is immediate.

## Student inbox and unread badges

Notices shows cards with an unread red accent, type, audience, date and priority. Students can filter All / Unread / Software releases and search loaded notices. Load more retrieves older items in pages of 50. Opening a notice displays the full message and marks only that signed-in user’s copy as read. Mark all as read affects accessible notices up to the newest notice already loaded; it does not mark newer arrivals read.

A red unread counter appears in the top navigation and on existing Notices/Notifications sidebar entries throughout dashboards and module pages. Counts refresh every 20 seconds while visible and immediately after a read action. There are no browser-push, SMS or email notifications in this update.

Existing assignment and project-grade notifications are included. Personal recipients are respected, legacy department/campus notices retain their scope, and global legacy broadcasts are now visible. The migration preserves known personal read records. A previous shared broadcast read flag is not copied to every user.

## Technical notes and checks

New tables: notice_publications, notice_campuses and notification_reads. The original notifications table remains the content source. Each read is keyed by notice and user. Campus audiences and notice publication are saved in one transaction. Publication requires administrator/HOD role, session authentication and CSRF validation. Link schemes are restricted and content renders as text rather than executable HTML.

Passed: PHP syntax checks; actual visibility SQL tested for global, campus, department and personal recipients; independent unread-count tests; card/read/publishing controller tests; shared badge path/update tests; and existing paper/project controller regressions. Live MySQL migration, authenticated publishing/delivery and visual browser validation remain to be performed on the deployment server.

Commands: node tests/notices_ui.cjs; node tests/notice_badge.cjs. The PHP helper tests/notices_scope.php emits visibility cases and verifies safe links for use with a SQL regression harness.
