Starters and Leavers on the Portal - edmozley/freeitsm GitHub Wiki
๐ฅ Starters & leavers on the portal (5.11.0)
HR staff are usually portal users, not analysts. This gives them a read-only Starters & leavers page on the self-service portal: who is joining, moving and leaving, and how far IT has got with each. Asked for by a supporter of the project.
Opening a case from the portal already works: a form in the request catalogue with the Open a Starters & leavers case action - see Starters & leavers. This page is the other half: seeing how it is going.
Switching it on
System โ Self-service portal โ Starters & leavers cases: choose Only members of chosen People groups and tick the groups - your HR team's, say - then Save.
It is off until you do, and there is deliberately no "Everyone" (the organisation chart has one): a leaver's case can be a dismissal, and the portal is where the whole company signs in. People groups come from a directory sync (System โ Single sign-on); a group switched off there stops counting at once.
What HR sees
A Starters & leavers tab, only for members of those groups, with two lists:
- Open - every open case, soonest date first.
- Recently done - cases finished in the last 60 days, latest first.
Each case shows the person, their job title, starter / mover / leaver, the first day / move date / last day, how many steps are done (with a bar), and who owns it - the person to ask.
Only their own company's cases. On an install with several companies, an HR member of one company never sees another's; a case with no company belongs to the Default company, the same rule as every list.
Not shown: the notes, the individual steps, the kit, the history, and cancelled cases. Those are the IT team's working record; the owner is one click away in Teams or email.
Under the hood
| File | What it does |
|---|---|
includes/portal_starters.php |
portalStartersAllowed() - the one rule: module on, setting groups, the person active and in an active chosen group (directory_group_members / directory_groups); fails closed. portalStartersCases() - the reader's company through PeopleOrgReader::portal() + peopleCompanyMatch(), progress through StartersService::progressSql() (tasks and, #316, tickets), a fixed list of columns |
api/self-service/starters.php |
GET ?view=open|done - asks portalStartersAllowed() every time |
self-service/starters.php |
The page; draws what the endpoint returns |
self-service/includes/header.php |
The tab (cap jml_cases, module starters) |
includes/self_service_settings.php |
self_service_jml_cases (off | groups, SELF_SERVICE_JML_MODES) and self_service_jml_cases_groups |
api/system/self_service_portal.php, system/self-service/index.php |
The setting: refuses any mode but off / groups, drops group ids that do not exist |
TRAP: the tab, the page and the endpoint all ask portalStartersAllowed() - a hidden tab is not a permission; the endpoint is the rule.
Test: tests/portal-starters.php (19 checks, a scratch zz_portaljml_* database it drops) - off by default; a member sees their own company's open and recently done cases with progress and owner, never another company's, a cancelled one, an old one or the notes; the Default company's member sees the cases with no company; refused for someone not in the group, a group switched off (beside it switched back on), the module off; the page and the tab; the setting refuses all and drops unknown groups.
See also: Starters & leavers ยท Self-service portal: what people can do ยท Organisation chart on the portal