# Features — sarugby (SA Rugby)

Evidence date: 2026-10-04. Source: `git@bitbucket.org:overdrive/sarugby.git`, `master` at `6048eba` (2019-04-28).

Status words used here:

- **Current** — present on `master` at `6048eba` and reached by a controller action.
- **Stub** — a file or action exists and the behaviour does not complete.
- **Not in git** — called by code, named by config, or named by the task scan, and no file exists at that path.
- **Theme demo** — Sportsline / WordPress sample markup shipped in layouts and views. It is not SA Rugby data.
- **Changed in the second commit** — the only delta after the import.

There are two commits, both on 2019-04-28, both by Mandus Momberg. Nothing in git history is a removed feature. The second commit only adds `.htaccess` and `public/.htaccess`. Deployment of `master` is **Unknown / Requires Confirmation**. The README says the tree was not run.

## Current

### Public site (`default`)

| Feature | Location | Notes |
|---|---|---|
| Home tournament board | `application/modules/default/controllers/IndexController.php` `indexAction` | Year filter. Featured / international / national / provincial. Current, completed, upcoming. |
| Latest results | `IndexController::lasttestresults`, `Model_Fixture::fixturesResultsTest2` | Up to 8 rows from `GameResults_view`. Cache file `public/archives/tournaments/latest_result.json`. |
| Upcoming fixtures on the home page | `IndexController::upcomingfixtures` | `Model_Fixture::fixturesUpcoming`. |
| Tournament profile | `TournamentsController::profileAction` | Param `tour`. JSON cache plus logs, matches, stats, results. |
| Fixtures, results, match, lineup, commentary | `TournamentsController` actions `fixtures`, `result`, `match`, `commentary`, `getmatchreport`, `team` | Lineup helpers are methods, not all are routed actions. |
| Player points | `TournamentsController::stats` | Weighted by `T_Tries`, `T_Conversion`, `T_Penalties`, `T_Dropgoal`, `T_22Mtry` on the match-report row. |
| News page | `NewsController::indexAction` | Reads `Results_all.json` and `Fixtures_all.json` through undefined constant `UPDATES_PATH`. Also loads non-hidden tournaments. |
| JSON refresh | `AjaxController::getdataAction` | Rewrites tournament, log, and squad JSON newer than `lastupdate.txt`. No auth check. |
| Maintenance switch | `public/index.php` | Commented out. Would show a 2018 maintenance image and stop. |

### Company accreditation (`companies`)

| Feature | Location | Notes |
|---|---|---|
| Registration form | `Companies_RegisterController::indexAction` | B-BBEE levels, company types, countries. |
| Create company and administrator | `newcompanyAction` | Duplicate registration number, ID number, or email is rejected. Password stored as `md5`. |
| Email confirmation | `validateemailAction` | Sets `Email_Confirmed` and `AllowLogin`. |
| Login and logout | `Companies_LoginController` | Table or view `CompaniesLogin`. Logout returns to `/companies/login`. |
| Forgot and reset password | `forgotAction`, `resetAction` | Reset link host is `http://` plus `SERVER_NAME`. Reset email includes the new password. |
| Company home counts | `Companies_IndexController::indexAction` | User count and permit count for the signed-in `CID`. Requires login. |
| Members | `UsersController` | Types: Administrator, Director, Management, Operations, Driver, Technician, General Staff. Photo under `public/archives/accreditation/`. |
| Permits | `PermitsController` | Event id 27. Number format `PE` + id padded to 6. Status stored as 2. Email notification. |
| Permit PDF action | `Companies_IndexController::getpermitpdfAction` | Action exists. Not fully traced in this pass. |
| Company profile and upload | `Companies_CompanyController` | `profileAction`, `uploadAction`, `getmembersAction`. |
| Events list | `Companies_EventsController::indexAction` | `getEvents(2)` then `print_r`. Debug output, not a finished screen. |

### Catering menu (`menu`)

| Feature | Location | Notes |
|---|---|---|
| Dates for a venue | `Menu_SessionController::datesAction` | Param `id` is the venue id. |
| Menus on a date | `menusAction` | Session id. |
| One menu | `menuAction` | Items from `SessionFood_Items`. |
| QR code | `menu/views/scripts/session/menu.phtml` | Google Chart image. Target `https://www.sarugby.online/menu/session/menu/id/{VID}`. |
| Nutrition and allergens | `nutritionAction` | `Allergens` column is JSON. Layout off. |

### Blue Card (`bluecard`)

| Feature | Location | Notes |
|---|---|---|
| Incident form | `Bluecard_IndexController::indexAction`, `views/scripts/index/index.phtml` | Causes, roles, positions 1–15, unions, ethnicity. |
| Thank-you reference | Same controller | Random id generated at render. Not stored. |
| Wizard script | Same view | jQuery Steps on `#example-basic`. |

### Shared platform

| Feature | Location | Notes |
|---|---|---|
| Module layouts | `library/PG/Controller/Plugin/LayoutPicker.php` | Layout name equals module name. |
| HTTPS and www redirect | `.htaccess` | Then internally rewrites into `public/`. Added in `6048eba`. |
| Zend front controller | `public/.htaccess`, `public/index.php` | Standard Zend 1 rewrite to `index.php`. |
| MySQL | `application/configs/application.ini` | Database name `teamwizz_SARU`. Password not repeated. |

## Stub

| Feature | Location | Why it is a stub |
|---|---|---|
| Default login, register, reset | `default/controllers/LoginController.php` | Uses `Model_Credentials` and `Model_DbTable_Countries`, which are not in `application/models`. `forgotAction` is empty. Redirect target `/first` has no controller. Mail copy is Footprint. |
| Cron queue and AppWiz push | `default/controllers/CronController.php` `queingAction`, `senddata_to_Api` | `Model_AccreditationsApplications`, `Model_AccreditationZone`, and `Model_Assessments` are not in git. PDF URL `/pdf/a6/id/{id}` has no controller. `IMG_PATH` is not defined in `index.php`. |
| `autorun` | `CronController::autorunAction` | Disables layout only. |
| `tournaments/news` | `TournamentsController::newsAction` | Empty body. |
| Company-module home | `company/controllers/IndexController.php` `indexAction` | Empty. `newcompanyAction` is a second registration implementation. `OrgController::indexAction` empty aside from `testAction`. |
| Companies authon / organisation | `AuthonController`, `OrganisationController` | `index` / `newcompany` / `profile` are thin. Not traced as a finished journey. |
| Menu index | `menu/controllers/IndexController.php` | `indexAction` present. Session controller holds the working menu actions. |
| Blue Card save | `bluecard` index | Form does not post into an insert. |
| `indexdump` and `indextest` | `IndexController` | Test variants of the home action. `indexdumpAction` echoes `TEST`. |
| `ajax/test` | `AjaxController::testAction` | Prints fixture rows and exits. |
| Companies `test` actions | Several companies controllers | Print a member row or a permit and exit. They contain a hardcoded identity number. The number is not repeated here. |

## Not in git

| Item | Why it is named |
|---|---|
| `sonar-project.properties`, `sonarqube_scan.bat` | Task-creation scan of the scan-host tree. Absent at `6048eba`. |
| `public/archives/**` | Gitignored. Required at runtime for JSON and images. |
| `Model_Credentials` | `default/login`. |
| `Model_DbTable_Countries` | `default/login/register`. |
| `Model_AccreditationsApplications`, `Model_AccreditationZone`, `Model_Assessments` | `CronController`. |
| Layouts `union.phtml`, `referee.phtml`, `gir.phtml`, `accreditations.phtml` | Named in `application.ini`. Not in `application/layouts/`. |
| Modules `admin`, `union`, `referee`, `gir`, `accreditations` | Same ini keys. No module directory. |
| PDF module or `a6` action | URL built in `CronController::addtozip`. |
| Database dump | README points at an S3 backup. SQL is not in the repo. |
| Dockerfile, CI config, appspec | Not present. HHVM command exists only in `Readme.md`. |

`Model_GirProfile` (`gir_profile`) is in git. No `gir` module uses it in the controllers that were listed.

## Theme demo

`application/layouts/default.phtml` is a Sportsline theme shell: WordPress emoji script, WooCommerce stylesheet names, contact-form-7, and RSS links aimed at `demo.themeum.com`. The document title is the SA Rugby title. `menu/views/scripts/menu/default.phtml` links Home to `http://www.sarugby.co.za`. `menu/views/scripts/menu/template.phtml` posts search to the Themeum demo. `tournaments/news.phtml` contains demo article cards (baseball, ice hockey, football) with Themeum image URLs.

Those pages are **Theme demo** plus a SA Rugby title, not evidence that this repository runs WooCommerce or WordPress.

## Changed in the second commit

`6048eba` adds:

- Root `.htaccess`: force HTTPS, force `www`, rewrite the URI under `public/` when it does not already start with `/public/`.
- `public/.htaccess`: serve real files, otherwise Zend `index.php`.

No application PHP changed in that commit.

## Deprecated or removed

Git history does not show a deleted feature. Duplicate files left in the tree are not wired as separate products:

| File | Note |
|---|---|
| `application/models/Copy of Fixture.php` | Second `class Model_Fixture`. Zend loads `Fixture.php` by class name. This copy is not the autoload target. |
| `application/modules/default/controllers/Copy of AjaxController.php` | Not a class name Zend will route. |
| `application/layouts/Copy of companies.phtml` | Not selected by the layout picker. |
| `application/layouts/companiess.phml` | Extension is `.phml`, not `.phtml`. |

## Planned

No issue list, TODO file, or roadmap was found. The README's untested Docker and database-restore notes are a bring-up suggestion, not a scheduled feature.

Commented code that is not current behaviour:

- Maintenance page in `public/index.php`.
- AppWiz URL `https://footprintapp.net/test/recievedata` in `CronController`.
- `IndexController` sort of tournaments by start date is commented out before the later sort of upcoming groups.
