# MEGA Setup edit and bulk delete update

The administrator now has **Manage setup** in the navigation and **Edit / bulk delete existing records** on Setup.

- Edit department names and department codes, and objective titles and objective codes.
- Edit an operational objective's strategic parent within the same financial year.
- Select one, several or all departments or objectives and click Delete selected (with confirmation).
- Database transaction protects bulk deletion from partial removal if one selected record cannot be deleted.
- A department with existing workshops or risks cannot be deleted.
- An objective referenced by a risk or a strategic objective with linked operational objectives cannot be deleted. To remove a hierarchy, delete eligible operational objectives first.
- Deleting unused departments clears only their planning links and code mappings; deleting unused objectives clears their department mappings.
- Operations are limited to administrators, use the existing CSRF token, and create audit log entries.
- Existing `app/config.php` was not edited.

## Deploy
Back up files and the MySQL database, then replace application files from this archive while retaining the current server's `app/config.php`. Do not re-run `install.php` or import `schema.sql` over an existing installation. Log in as administrator and open `?p=planning_manage`. The two mapping tables are created when this page loads if absent.

## Testing caveat
PHP syntax validation passed; live MySQL execution and permission tests are still needed on the staging server. Test edits and delete protections with fictional records before using live planning data.
