I'm struggling with this - the documentation for reports is really out of date: http://doc.silverstripe.org/site-reports - and I'm having trouble piecing the new parts together. This is far as I've got:
/mysite/_config.php
SS_Report::register("SS_Report", "UsersOnlineReport");
/mysite/code/CustomReports.php
<?php
class UsersOnlineReport extends SS_Report {
function title() {
return "Users Online";
}
function description() {
return "Shows all Users active in the past 15 minutes";
}
function records() {
$members = DataObject::get('Member', "\"LastVisited\" > NOW() - INTERVAL 15 MINUTE");
return $members;
}
...
...and that's where I hit some major confusion - do we still use fieldsToShow() or do we use columns() ? And if so what syntax? I want to list the username, e-mail address, and when they were last active.
Cheers
Tama