Skip to content

Commit

Permalink
fix: render records held usage graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Chloe070196 committed Jul 23, 2024
1 parent 31616b5 commit a382320
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions code/web/services/ILS/UsageGraphs.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ function launch() {
'backgroundColor' => 'rgba(154, 75, 244, 0.2)',
'data' => [],
];
$recordILSUsage->selectAdd('SUM(recordsHeld) as sumRecordsHeld');
$recordILSUsage->selectAdd('SUM(IF(timesUsed>0,1,0)) as numRecordsUsed');
}
if ($stat == 'totalHolds') {
$dataSeries['Total Holds'] = [
Expand Down Expand Up @@ -232,6 +232,10 @@ function launch() {
/** @noinspection PhpUndefinedFieldInspection */
$dataSeries['Supplemental Files Downloaded']['data'][$curPeriod] = $recordILSUsage->sumSupplementalFilesDownloaded;
}
if ($stat == 'recordsHeld') {
/** @noinspection PhpUndefinedFieldInspection */
$dataSeries['Total Holds']['data'][$curPeriod] = $recordILSUsage->numRecordsUsed;
}
if ($stat == 'totalHolds') {
/** @noinspection PhpUndefinedFieldInspection */
$dataSeries['Total Holds']['data'][$curPeriod] = $recordILSUsage->totalHolds;
Expand All @@ -241,7 +245,7 @@ function launch() {

$interface->assign('columnLabels', $columnLabels);
$interface->assign('dataSeries', $dataSeries);
$interface->assign('translateDataSeries', true);
$interface->assign('translateDataSeries', true);
$interface->assign('translateColumnLabels', false);

$interface->assign('graphTitle', $title);
Expand Down

0 comments on commit a382320

Please sign in to comment.