# Features — Paterson & Cooke Management System

Evidence date: 2026-10-08. Source: `git@bitbucket.org:overdrive/patersoncooke.git`, `master` at `008c5ac` (2022-02-24).

Status words used here:

- **Current** — present on `master` at `008c5ac` and reachable from a page that exists.
- **Leftover** — a file or code path is in git and is not the path the live page uses, or it cannot run because a dependency is missing.
- **Commented out** — the call is in the file and is disabled with a PHP comment.

Git has four commits, all in February 2022. Feature history before that import is not in git. Dated copies inside the tree are listed under Leftover.

## Current

### Sign-in and shell

| Feature | Location | Notes |
|---|---|---|
| Login form | `login.php` | Logo `include/images/pcce_logo.jpg`. Client-side MD5 then server check against personnel. |
| Cookie session | `include/system.inc.php` | Cookie name `ckyPCCE`. |
| Home welcome | `index.php` | "Welcome to Paterson & Cooke Management System". |
| Database menu | `include/menu.inc.php`, `include/javascript/menu.js` | Items come from `tblmenulevel0` and `tblmenulevel1`. |
| Version footer | `include/version.inc.php` | "Paterson & Cooke Management System [v1.2.1, 4 Jan 2010]". Shows the display name from the cookie. |
| Page chrome | `include/header.inc.php`, `include/style/style.css`, `include/style/menu.css` | Title "Paterson & Cooke Management DB". Cache disabled by meta tags. |

### People and access

| Feature | Location | Notes |
|---|---|---|
| Personnel list, search, edit, soft-delete | `personnel.php`, `include/personnel/personnel.cls.php` | Delete sets `blnActive = 2`. |
| Billing codes on a person | `ShowPersonnelBC` | Included checkboxes and one primary. Internal-disbursement codes are disabled on the matrix. |
| Security levels | `securitylevel.php`, `include/general/securitylevel.cls.php` | None / View / Full per area. |
| Workgroups | `workgroup.php` | |
| Settings: rows per page | `settings.php` | Single numeric setting used by list paging. |

### Organisation, clients, rates

| Feature | Location | Notes |
|---|---|---|
| Offices | `office.php`, `include/general/office.cls.php` | Address, phone, email, active, fee structures. |
| Clients | `client.php`, `include/client/client.cls.php` | Name, postal address, VAT, active. |
| Contacts | `contact.php`, `include/client/contact.cls.php` | Belong to a client. |
| Currencies | `currency.php` | Name and code. |
| Fee structures | `feestructure.php` | Named structure in a currency. Can load all billing codes. |
| Billing codes | `billingcode.php` | Billable or internal disbursement, plus activity-code links. |
| Billing rates | `billingrate.php` | External, internal, and cost per fee structure and billing code. |
| Activity categories | `activitycategory.php` | Project-work and leave flags are mutually exclusive in the form script. |
| Activity codes | `activitycode.php` | Constraint none, 4 hours, or 8 hours. Linked to billing codes. |
| Project statuses | `projectstatus.php` | Enter, Review, Documents checkboxes. |

### Projects

| Feature | Location | Notes |
|---|---|---|
| Project list and edit | `project.php`, `include/project/project.cls.php` | Number, status, manager, director, client, text contacts, order number, billing details, offices. |
| Project billing rates on the project page | `project.cls.php` acts 4, 41, 42, 5 | Load default, load new, save. |
| Project proposal | `project.cls.php` acts 6 and 7 | Areas, deliverables, hours, values. `addRow` in the page script. |

### Timesheets

| Feature | Location | Notes |
|---|---|---|
| Weekly grid | `timesheet.php`, `include/personnel/timesheet/timesheet.cls.php` | Seven days, multiple rows, 36 half-hour cells. |
| Copy a previous day onto an empty day | `copyTimesheet` in the timesheet script | Only when the target day has no rows. Submits as save. |
| Area and activity XML | `timesheet.php` before `checkLogin` | Used when the project or area changes. |
| Review | `timesheetreview.php`, `timesheetreview.cls.php` | Print and Accept. |
| Completed-timesheet board | `completedtimesheet.php` | Week picker from 2007. Reminder email. Reactivate. |

### Invoicing

| Feature | Location | Notes |
|---|---|---|
| Invoice search and list | `invoice.php`, `include/invoice/invoice.cls.php` | |
| Invoice header | `InvoiceDetails` | External, internal, fixed price, dates, number, office. |
| Timesheet lines on an invoice | `invoicetimesheet.php`, `invoicetimesheet.cls.php` | Include or exclude lines. Writes `tblInvoiceItem`. |
| Invoice fees | `invoice.cls.php` `ViewInvoiceFees`, `SaveIF` | Fixed price groups by office. |
| Disbursements | `disbursement.php`, `disbursement.cls.php` | Site allowance, internal, external. |
| Invoice summary page | `invoicesummary.php` | Separate summary class under `include/personnel/timesheet/`. |
| Delete invoice | `invoice.php` act 7 | Deletes the invoice and the five child link tables listed in `Delete()`. |

### Reports

All of these are opened from `reportconsole.php` as `{name}.php`.

| Report | Page | Class |
|---|---|---|
| Close-Out | `closeout.php` | `include/reports/closeout.cls.php` |
| Dashboard — Resource Utilization (Office) | `dashboard.php` | `include/reports/dashboard.cls.php` |
| External disbursements | `externaldisbursement.php` | `include/reports/externaldisbursement.cls.php` |
| Incomplete timesheet | `incompletetimesheet.php` | `include/reports/incompletetimesheet.cls.php` |
| Individual summary by activity | `individualsummarybyactivity.php` | `include/reports/individualsummarybyactivity.cls.php` |
| Individual summary by day | `individualsummarybyday.php` | `include/reports/individualsummarybyday.cls.php` |
| Individual summary by project | `individualsummarybyproject.php` | `include/reports/individualsummarybyproject.cls.php` |
| Internal disbursements | `internaldisbursement.php` | `include/reports/internaldisbursement.cls.php` |
| Invoice report | `invoicereport.php` | `include/reports/invoicereport.cls.php` |
| Leave | `leave.php` | `include/reports/leave.cls.php` |
| Project director | `projectdirector.php` | `include/reports/projectdirector.cls.php` |
| Project manager | `projectmanager.php` | `include/reports/projectmanager.cls.php` |
| Project summary | `projectsummary.php` | `include/reports/projectsummary.cls.php` |
| Timesheet detail (project) | `timesheetdetail.php` | `include/reports/timesheetdetail.cls.php` |
| Timesheet detail (all) | `timesheetdetailall.php` | `include/reports/timesheetdetailall.cls.php` |
| Timesheet summary | `timesheetsummary.php` | `include/reports/timesheetsummary.cls.php` |
| Utilisation graph | `utilisationgraph.php` | `include/reports/utilisationgraph.cls.php` |

View and Printer-Friendly open a window. Export navigates in place and, on the timesheet and project-summary reports that were inspected, sends the HTML table with an Excel content type.

The utilisation graph draws an image in PHP (`createImage`, `plot`, `drawDiamond` in `utilisationgraph.cls.php`).

## Leftover

| Item | Location | Why it is leftover |
|---|---|---|
| Old MySQL class | `mysql.cls.php` (repository root) | Uses `mysql_*`. `system.inc.php` includes `include/database/mysql.cls.php` (mysqli) instead. |
| User admin | `user.php`, `include/general/user.cls.php` | Calls `sql_user_*`, which are not defined. Gate is `checkSecurity("90")`. Displays `arrUserLevels` (View Only, RSVP, Administrator). |
| Unused security helper | `checkSecurity_NOTUSED` in `system.inc.php` | Same numeric levels. No page calls it. |
| Project billing rate page | `projectbillingrate.php` | Includes `include/project/projectbillingrate.cls.php`, which is not in the tree. The class is in `include/project/zzprojectbillingrate.cls.php`. Rates are also edited inside `project.php`. |
| Timesheet class copies | `include/personnel/timesheet/timesheet.cls.20100107.php`, `timesheetreview.cls.20100107.php`, `include/personnel/completedtimesheet.cls.20100107.php` | Dated snapshots. Live pages include the files without the date. |
| Old project summary | `include/reports/projectsummary_old.cls.php` | `projectsummary.php` includes `projectsummary.cls.php`. |
| Root leave class | `leave.cls.php` | `leave.php` includes `include/reports/leave.cls.php`. |
| Excel writer | `include/excelwriter.inc.php` | Class `ExcelWriter` (header comment: Harish Chauhan, 31 Dec 2004). No page includes it. |
| Sample spreadsheet script | `write.php` | Writes a three-row HTML table as `dominic.xls`. No login check. Comment mentions `http://webdev2/pcce/write.php`. |
| Mail test script | `temp.php` | Calls `mail()` with a hardcoded recipient. No login check. |
| PHP info | `phpinfo.php` | Calls `phpinfo()`. No login check. |
| Empty report include | `include/reports/leave.php` | Eight-byte file. Not the leave report. |

## Commented out

| Behaviour | Where |
|---|---|
| Invoice permission gate | `invoice.php` (`blnInvoice`) |
| Report console permission gate | `reportconsole.php` (`blnReportConsole`) |
| Login on leave, incomplete timesheet, internal disbursement, external disbursement | Those four page headers |
| Project contact dropdown loader | `project.cls.php` client `<select onchange=''>`. The function `loadContactCombo` still exists. |
| Invoice list edit icon security | `invoice.cls.php` around the list actions |

## Changed in git (February 2022)

| Change | Commit | Files |
|---|---|---|
| `mysql_*` calls in the live connection class replaced with `mysqli_*`. Menu and login queries updated to pass the connection. Two SQL helper signatures adjusted. | `0eb150f` | `include/database/mysql.cls.php`, `include/database/sql.inc.php`, `include/menu.inc.php`, `login.php` |
| Insert id uses the connection handle | `008c5ac` | `include/database/mysql.cls.php` `getLastID` |

No feature was added or removed in those commits. The root `mysql.cls.php` was not updated.

## Not in this repository

- Schema, seed data, menu rows, and security-level rows.
- Deployment scripts, virtual host, TLS, or a production URL (the `webdev2` host appears only in a comment in `write.php`).
- Tests.
- A planned-feature list. Nothing in the tree is marked as a future release.

## Deprecated or removed

Git does not show a removed feature. The leftover table is the closest evidence of retired paths. Treating them as deprecated is **Inferred** from the fact that live pages include different files. No comment says "deprecated".
