Skip to content

v1.6.19

Choose a tag to compare

@mastacontrola mastacontrola released this 29 Aug 18:13
· 15 commits to main since this release
fa8fbd5

The eight bundled plugin reports name themselves in the Reports menu, and can
export the whole result set rather than the page the browser is holding.

Consumes the REPORT_TITLE_DATA event added in
fogproject#1470.

Two names for one screen

The Reports menu labelled an entry with ucwords() of the file name, so
every bundled plugin report had a sidebar entry that disagreed with the page it
opened:

Report Sidebar said The page said
ou_report Ou Report Export OUs
ldap_report Ldap Report Export LDAP Servers
location_report Location Report Export Locations
windowskey_report Windowskey Report Export Windows Keys
wolbroadcast_report Wolbroadcast Report Export WOL Broadcasts
subnetgroup_report Subnetgroup Report Export Subnet Groups
taskstateedit_report Taskstateedit Report Export Task States
tasktypeedit_report Tasktypeedit Report Export Task Types

Each plugin's existing menu hook now names its own report through
REPORT_TITLE_DATA, keyed the way the menu and the base64 f parameter
already are. The report reads the same map back through reportTitle() for its
heading, so the two cannot drift apart again.

The rows moved to reportRows()

fogproject#1467 gave
report toolbars a CSV (All) button, because the DataTables export buttons
beside it can only see rows the browser is holding — which on a serverSide
table is one page. That button posts to sub=exportAll, which serves
reportRows().

A report still overriding getList() cannot be reached that way, and the
download would be an empty file: no error, nothing logged, a CSV that looks
like it worked. That is why the button is opt-in in core, and why these eight
now drop getList() for reportRows() and ask for it with
{fullExport: true}.

Compatibility

This release needs a core carrying REPORT_TITLE_DATA. FOGProject/fogproject
bumps FOG_PLUGINS_VERSION to v1.6.19 alongside it. On a core older than
fogproject#1467 there is no ReportManagement::reportRows() for these reports to
feed, so the grids would come up empty.

Verification

tests/report-titles-are-registered.test.php105 checks. Source analysis
rather than execution, because this repository is fetched on its own and CI has
no fogproject checkout; the assertions are on the agreement between four
things
(report file name, class name, hook key, JS case), which a stray
mention cannot satisfy.

Six mutations, all red: misspelling the hook key; dropping the event
registration; putting a literal title back; keeping getList() alongside
reportRows(); asking for fullExport without the seam; renaming the class so
it derives a key its file does not.

11/11 in tests/run-all.sh.

PR: #30