From 6442cfee2ddb2a4c5229f792512467b2827434c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 26 Jul 2024 17:21:23 +0100 Subject: [PATCH 01/15] feat: summon dashboard links to usage graph pages --- .../themes/responsive/Summon/summonDashboard.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/web/interface/themes/responsive/Summon/summonDashboard.tpl b/code/web/interface/themes/responsive/Summon/summonDashboard.tpl index ca630ed65d..13a80bfe49 100644 --- a/code/web/interface/themes/responsive/Summon/summonDashboard.tpl +++ b/code/web/interface/themes/responsive/Summon/summonDashboard.tpl @@ -6,7 +6,7 @@
-

{translate text="Active Users" isAdminFacing=true}

+

{translate text="Active Users" isAdminFacing=true}

@@ -32,7 +32,7 @@
-

{translate text="Number of Records Viewed" isAdminFacing=true}

+

{translate text="Number of Records Viewed" isAdminFacing=true}

@@ -58,7 +58,7 @@
-

{translate text="Number of Records Clicked" isAdminFacing=true}

+

{translate text="Number of Records Clicked" isAdminFacing=true}

@@ -84,7 +84,7 @@
-

{translate text="Total Clicks" isAdminFacing=true}

+

{translate text="Total Clicks" isAdminFacing=true}

From 84319b00900abb292381353c404e1799a93cc65e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 26 Jul 2024 17:50:45 +0100 Subject: [PATCH 02/15] feat: Summon_UsageGraphs class --- code/web/services/Summon/UsageGraphs.php | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 code/web/services/Summon/UsageGraphs.php diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php new file mode 100644 index 0000000000..ced3ff6b56 --- /dev/null +++ b/code/web/services/Summon/UsageGraphs.php @@ -0,0 +1,8 @@ + Date: Fri, 26 Jul 2024 17:53:11 +0100 Subject: [PATCH 03/15] feat: check user access permission --- code/web/services/Summon/UsageGraphs.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index ced3ff6b56..810b87d7ea 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -5,4 +5,11 @@ require_once ROOT_DIR . '/sys/Summon/UserSummonUsage.php'; require_once ROOT_DIR . '/sys/Summon/SummonRecordUsage.php'; -class Summon_UsageGraphs extends Admin_Admin {} \ No newline at end of file +class Summon_UsageGraphs extends Admin_Admin { + function canView(): bool { + return UserAccount::userHasPermission([ + 'View Dashboards', + 'View System Reports', + ]); + } +} \ No newline at end of file From 5fec5c91fb222dda2b0b210bbf4debe5dddaaeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 26 Jul 2024 17:59:32 +0100 Subject: [PATCH 04/15] feat: keep summon section active --- code/web/services/Summon/UsageGraphs.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index 810b87d7ea..a766c900a7 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -6,6 +6,9 @@ require_once ROOT_DIR . '/sys/Summon/SummonRecordUsage.php'; class Summon_UsageGraphs extends Admin_Admin { + function getActiveAdminSection(): string { + return 'summon'; + } function canView(): bool { return UserAccount::userHasPermission([ 'View Dashboards', From cc17fc0edb84b660aeb33c3ade1c64b01d5b777e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 26 Jul 2024 18:01:37 +0100 Subject: [PATCH 05/15] feat: get breadcrumbs --- code/web/services/Summon/UsageGraphs.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index a766c900a7..86c6756f0a 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -6,13 +6,24 @@ require_once ROOT_DIR . '/sys/Summon/SummonRecordUsage.php'; class Summon_UsageGraphs extends Admin_Admin { + function getActiveAdminSection(): string { return 'summon'; } + function canView(): bool { return UserAccount::userHasPermission([ 'View Dashboards', 'View System Reports', ]); } + + function getBreadcrumbs(): array { + $breadcrumbs = []; + $breadcrumbs[] = new Breadcrumb('/Admin/Home', 'Administration Home'); + $breadcrumbs[] = new Breadcrumb('/Admin/Home#summon', 'Summon'); + $breadcrumbs[] = new Breadcrumb('/Summon/SummonDashboard', 'Summon Usage Dashboard'); + $breadcrumbs[] = new Breadcrumb('', 'Usage Graph'); + return $breadcrumbs; + } } \ No newline at end of file From 5fdb0276413ee2f50e91db0fae186a44bf7dfcf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Fri, 26 Jul 2024 18:12:53 +0100 Subject: [PATCH 06/15] feat: assign graph title on lauch --- code/web/services/Summon/UsageGraphs.php | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index 86c6756f0a..e861a26443 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -7,6 +7,31 @@ class Summon_UsageGraphs extends Admin_Admin { + function launch() { + global $interface; + + $title = 'Summon Usage Graphs'; + $stat = $_REQUEST['stat']; + + switch ($stat) { + case 'activeUsers': + $title .= ' - Active Users'; + break; + case 'numRecordsViewed': + $title .= ' - Number of Records Viewed'; + break; + case 'numRecordsClicked': + $title .= ' - Number of Records Clicked'; + break; + case 'totalClicks': + $title .= ' - Total Clicks'; + break; + } + + $interface->assign('graphTitle', $title); + $this->display('usage-graph.tpl', $title); + } + function getActiveAdminSection(): string { return 'summon'; } From 6aa913532def3a33eaa13fe60b63f65eee44bb51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 11:20:42 +0100 Subject: [PATCH 07/15] fix: correct graph title typo --- code/web/services/Summon/UsageGraphs.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index e861a26443..581139e9ac 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -10,7 +10,7 @@ class Summon_UsageGraphs extends Admin_Admin { function launch() { global $interface; - $title = 'Summon Usage Graphs'; + $title = 'Summon Usage Graph'; $stat = $_REQUEST['stat']; switch ($stat) { From c58981d52156ec3435eee2d0aae8b81775867fbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 12:25:03 +0100 Subject: [PATCH 08/15] feat: summon usage graph template --- .../themes/responsive/Summon/usage-graph.tpl | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 code/web/interface/themes/responsive/Summon/usage-graph.tpl diff --git a/code/web/interface/themes/responsive/Summon/usage-graph.tpl b/code/web/interface/themes/responsive/Summon/usage-graph.tpl new file mode 100644 index 0000000000..2d121f5196 --- /dev/null +++ b/code/web/interface/themes/responsive/Summon/usage-graph.tpl @@ -0,0 +1,85 @@ +{strip} +
+

{translate text=$graphTitle isAdminFacing=true}

+
+ +
+ +

{translate text="Raw Data" isAdminFacing=true}

+
+ + + + + {foreach from=$dataSeries key=seriesLabel item=seriesData} + + {/foreach} + + + + {foreach from=$columnLabels item=label} + + + {foreach from=$dataSeries item=seriesData} + + {/foreach} + + {/foreach} + +
{translate text="Date" isAdminFacing=true}{if !empty($translateDataSeries)}{translate text=$seriesLabel isAdminFacing=true}{else}{$seriesLabel}{/if}
{if !empty($translateColumnLabels)}{translate text=$label isAdminFacing=true}{else}{$label}{/if}{if (empty($seriesData.data.$label))}0{else}{$seriesData.data.$label|number_format}{/if}
+
+
+{/strip} +{literal} + +{/literal} \ No newline at end of file From e39e49501b5003a5e56770ffcbe3e81d4c0d0f98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 12:34:22 +0100 Subject: [PATCH 09/15] feat: fetch and render summon usage record data This uses the same SQL queries as in the summon dashboard in order to fetch the relevant data for each graph and raw data table from the summon_usage table in the aspen db, so that they are then rendered on the matching usage graph page (implementing the logic from the admin usage graphs). --- code/web/services/Summon/UsageGraphs.php | 71 ++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index 581139e9ac..62362bda30 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -12,6 +12,14 @@ function launch() { $title = 'Summon Usage Graph'; $stat = $_REQUEST['stat']; + if (!empty($_REQUEST['instance'])) { + $instanceName = $_REQUEST['instance']; + } else { + $instanceName = ''; + } + + $dataSeries = []; + $columnLabels = []; switch ($stat) { case 'activeUsers': @@ -27,6 +35,69 @@ function launch() { $title .= ' - Total Clicks'; break; } + if ( + $stat == 'numRecordsViewed' || + $stat == 'numRecordsClicked' || + $stat == 'totalClicks' + ) { + $summonRecordUsage = new SummonRecordUsage(); + $summonRecordUsage->groupBy('year, month'); + if (!empty($instanceName)) { + $summonRecordUsage->instance = $instanceName; + } + $summonRecordUsage->selectAdd(); + $summonRecordUsage->selectAdd('year'); + $summonRecordUsage->selectAdd('month'); + $summonRecordUsage->orderBy('year, month'); + if ($stat == 'numRecordsViewed') { + $dataSeries['Number of Records Viewed'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $summonRecordUsage ->selectAdd('SUM(IF(timesViewedInSearch>0,1,0)) as numRecordsViewed'); + } + if ($stat == 'numRecordsClicked') { + $dataSeries['Number of Records Clicked'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $summonRecordUsage ->selectAdd('SUM(IF(timesUsed>0,1,0)) as numRecordsUsed'); + } + if ($stat == 'totalClicks') { + $dataSeries['Total Clicks'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $summonRecordUsage ->selectAdd('SUM(timesUsed) as numClicks'); + } + + // Collect results + $summonRecordUsage->find(); + while ($summonRecordUsage->fetch()) { + $curPeriod = "{$summonRecordUsage->month}-{$summonRecordUsage->year}"; + $columnLabels[] = $curPeriod; + if ($stat == 'numRecordsViewed') { + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Number of Records Viewed']['data'][$curPeriod] = $summonRecordUsage->numRecordsViewed; + } + if ($stat == 'numRecordsClicked') { + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Number of Records Clicked']['data'][$curPeriod] = $summonRecordUsage->numRecordsUsed; + } + if ($stat == 'totalClicks') { + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Total Clicks']['data'][$curPeriod] = $summonRecordUsage->numClicks; + } + + } + } + $interface->assign('columnLabels', $columnLabels); + $interface->assign('dataSeries', $dataSeries); + $interface->assign('translateDataSeries', true); + $interface->assign('translateColumnLabels', false); $interface->assign('graphTitle', $title); $this->display('usage-graph.tpl', $title); From a082ed32155a3ef5b2d7dd5f6367dec501ef5642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 12:43:41 +0100 Subject: [PATCH 10/15] fix: amend usage graph urls Some of the links to usage graphs have malformed URLs where '&instance=' is missing from the string. This adds this substring where needed. --- .../interface/themes/responsive/Summon/summonDashboard.tpl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/web/interface/themes/responsive/Summon/summonDashboard.tpl b/code/web/interface/themes/responsive/Summon/summonDashboard.tpl index 13a80bfe49..3927b06568 100644 --- a/code/web/interface/themes/responsive/Summon/summonDashboard.tpl +++ b/code/web/interface/themes/responsive/Summon/summonDashboard.tpl @@ -32,7 +32,7 @@
-

{translate text="Number of Records Viewed" isAdminFacing=true}

+

{translate text="Number of Records Viewed" isAdminFacing=true}

@@ -58,7 +58,7 @@
-

{translate text="Number of Records Clicked" isAdminFacing=true}

+

{translate text="Number of Records Clicked" isAdminFacing=true}

@@ -84,7 +84,7 @@
-

{translate text="Total Clicks" isAdminFacing=true}

+

{translate text="Total Clicks" isAdminFacing=true}

From e968383976c8fa0d9b61bcf6d2f613149bc1e030 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 15:43:59 +0100 Subject: [PATCH 11/15] feat: fetch and render user summon usage data Fetches data for the active users usage graph and raw data table from the user_summon_usage table in the aspen db, so it can then be rendered implementing the same logic as for the admin usage graphs. Since there is only one usage graph for user summon usage data, the control flow logic has been simplified. --- code/web/services/Summon/UsageGraphs.php | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index 62362bda30..a68ffbf92f 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -35,6 +35,36 @@ function launch() { $title .= ' - Total Clicks'; break; } + + // gets data from from user_summon_usage + if ($stat == 'activeUsers') { + $userSummonUsage = new UserSummonUsage(); + $userSummonUsage->groupBy('year, month'); + if (!empty($instanceName)) { + $userSummonUsage->instance = $instanceName; + } + $userSummonUsage->selectAdd(); + $userSummonUsage->selectAdd('year'); + $userSummonUsage->selectAdd('month'); + $userSummonUsage->orderBy('year, month'); + + $dataSeries['Active Users'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $userSummonUsage->selectAdd('COUNT(DISTINCT userId) as activeUsers'); + + // Collects results + $userSummonUsage->find(); + while($userSummonUsage->fetch()) { + $curPeriod = "{$userSummonUsage->month}-{$userSummonUsage->year}"; + $columnLabels[] = $curPeriod; + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Active Users']['data'][$curPeriod] = $userSummonUsage->activeUsers; + } + } + if ( $stat == 'numRecordsViewed' || $stat == 'numRecordsClicked' || From f4f1fc4e1d167102d435bcd754d38eee76e6bdd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 15:45:44 +0100 Subject: [PATCH 12/15] style: adjust indentation --- code/web/services/Summon/UsageGraphs.php | 94 ++++++++++++------------ 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index a68ffbf92f..72ecdd8b67 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -65,65 +65,65 @@ function launch() { } } + // gets data from from summon_usage if ( $stat == 'numRecordsViewed' || $stat == 'numRecordsClicked' || $stat == 'totalClicks' - ) { - $summonRecordUsage = new SummonRecordUsage(); - $summonRecordUsage->groupBy('year, month'); - if (!empty($instanceName)) { - $summonRecordUsage->instance = $instanceName; - } - $summonRecordUsage->selectAdd(); - $summonRecordUsage->selectAdd('year'); - $summonRecordUsage->selectAdd('month'); - $summonRecordUsage->orderBy('year, month'); + ){ + $summonRecordUsage = new SummonRecordUsage(); + $summonRecordUsage->groupBy('year, month'); + if (!empty($instanceName)) { + $summonRecordUsage->instance = $instanceName; + } + $summonRecordUsage->selectAdd(); + $summonRecordUsage->selectAdd('year'); + $summonRecordUsage->selectAdd('month'); + $summonRecordUsage->orderBy('year, month'); + if ($stat == 'numRecordsViewed') { + $dataSeries['Number of Records Viewed'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $summonRecordUsage ->selectAdd('SUM(IF(timesViewedInSearch>0,1,0)) as numRecordsViewed'); + } + if ($stat == 'numRecordsClicked') { + $dataSeries['Number of Records Clicked'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $summonRecordUsage ->selectAdd('SUM(IF(timesUsed>0,1,0)) as numRecordsUsed'); + } + if ($stat == 'totalClicks') { + $dataSeries['Total Clicks'] = [ + 'borderColor' => 'rgba(255, 99, 132, 1)', + 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', + 'data' => [], + ]; + $summonRecordUsage ->selectAdd('SUM(timesUsed) as numClicks'); + } + // Collect results + $summonRecordUsage->find(); + while ($summonRecordUsage->fetch()) { + $curPeriod = "{$summonRecordUsage->month}-{$summonRecordUsage->year}"; + $columnLabels[] = $curPeriod; if ($stat == 'numRecordsViewed') { - $dataSeries['Number of Records Viewed'] = [ - 'borderColor' => 'rgba(255, 99, 132, 1)', - 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', - 'data' => [], - ]; - $summonRecordUsage ->selectAdd('SUM(IF(timesViewedInSearch>0,1,0)) as numRecordsViewed'); + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Number of Records Viewed']['data'][$curPeriod] = $summonRecordUsage->numRecordsViewed; } if ($stat == 'numRecordsClicked') { - $dataSeries['Number of Records Clicked'] = [ - 'borderColor' => 'rgba(255, 99, 132, 1)', - 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', - 'data' => [], - ]; - $summonRecordUsage ->selectAdd('SUM(IF(timesUsed>0,1,0)) as numRecordsUsed'); + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Number of Records Clicked']['data'][$curPeriod] = $summonRecordUsage->numRecordsUsed; } if ($stat == 'totalClicks') { - $dataSeries['Total Clicks'] = [ - 'borderColor' => 'rgba(255, 99, 132, 1)', - 'backgroundColor' => 'rgba(255, 99, 132, 0.2)', - 'data' => [], - ]; - $summonRecordUsage ->selectAdd('SUM(timesUsed) as numClicks'); + /** @noinspection PhpUndefinedFieldInspection */ + $dataSeries['Total Clicks']['data'][$curPeriod] = $summonRecordUsage->numClicks; } - - // Collect results - $summonRecordUsage->find(); - while ($summonRecordUsage->fetch()) { - $curPeriod = "{$summonRecordUsage->month}-{$summonRecordUsage->year}"; - $columnLabels[] = $curPeriod; - if ($stat == 'numRecordsViewed') { - /** @noinspection PhpUndefinedFieldInspection */ - $dataSeries['Number of Records Viewed']['data'][$curPeriod] = $summonRecordUsage->numRecordsViewed; - } - if ($stat == 'numRecordsClicked') { - /** @noinspection PhpUndefinedFieldInspection */ - $dataSeries['Number of Records Clicked']['data'][$curPeriod] = $summonRecordUsage->numRecordsUsed; - } - if ($stat == 'totalClicks') { - /** @noinspection PhpUndefinedFieldInspection */ - $dataSeries['Total Clicks']['data'][$curPeriod] = $summonRecordUsage->numClicks; - } - } } + } $interface->assign('columnLabels', $columnLabels); $interface->assign('dataSeries', $dataSeries); $interface->assign('translateDataSeries', true); From 9290f649c3bc2f8ab572c2f18422f85d6835d754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 15:46:15 +0100 Subject: [PATCH 13/15] style: add whitespace --- code/web/services/Summon/UsageGraphs.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/code/web/services/Summon/UsageGraphs.php b/code/web/services/Summon/UsageGraphs.php index 72ecdd8b67..d02630a317 100644 --- a/code/web/services/Summon/UsageGraphs.php +++ b/code/web/services/Summon/UsageGraphs.php @@ -17,7 +17,7 @@ function launch() { } else { $instanceName = ''; } - + $dataSeries = []; $columnLabels = []; @@ -64,7 +64,7 @@ function launch() { $dataSeries['Active Users']['data'][$curPeriod] = $userSummonUsage->activeUsers; } } - + // gets data from from summon_usage if ( $stat == 'numRecordsViewed' || @@ -80,6 +80,7 @@ function launch() { $summonRecordUsage->selectAdd('year'); $summonRecordUsage->selectAdd('month'); $summonRecordUsage->orderBy('year, month'); + if ($stat == 'numRecordsViewed') { $dataSeries['Number of Records Viewed'] = [ 'borderColor' => 'rgba(255, 99, 132, 1)', @@ -120,13 +121,13 @@ function launch() { if ($stat == 'totalClicks') { /** @noinspection PhpUndefinedFieldInspection */ $dataSeries['Total Clicks']['data'][$curPeriod] = $summonRecordUsage->numClicks; - } - } + } } - } + } + $interface->assign('columnLabels', $columnLabels); $interface->assign('dataSeries', $dataSeries); - $interface->assign('translateDataSeries', true); + $interface->assign('translateDataSeries', true); $interface->assign('translateColumnLabels', false); $interface->assign('graphTitle', $title); From a7f008b9e862ea6a48e8dd81833dfcf3eb24cdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Tue, 30 Jul 2024 17:19:56 +0100 Subject: [PATCH 14/15] merge: changelog changes --- code/web/release_notes/24.08.00.MD | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/web/release_notes/24.08.00.MD b/code/web/release_notes/24.08.00.MD index 2ae8e064f2..a6f3c2b1bc 100644 --- a/code/web/release_notes/24.08.00.MD +++ b/code/web/release_notes/24.08.00.MD @@ -135,7 +135,8 @@ To generate the passkey file, the following command should be run (as root): // chloe ### Other Updates -- Add usage graphs and raw data tables for ILS Integration. These can be accessed through the ILS Integration Dashboard +- Add usage graphs and raw data tables for ILS Integration. These can be accessed through the ILS Integration Dashboard (*CZ*) +- Add usage graphs and raw data tables for Summons. These can be accessed through the Summon Dashboard (*CZ*) ## This release includes code contributions from - ByWater Solutions From 167001d14e15e3cda4f3d779ba87da70ab9448c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Tue, 30 Jul 2024 16:53:07 +0100 Subject: [PATCH 15/15] fix: set isAdminFacing to true for graph links --- .../themes/responsive/Summon/summonDashboard.tpl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/web/interface/themes/responsive/Summon/summonDashboard.tpl b/code/web/interface/themes/responsive/Summon/summonDashboard.tpl index 3927b06568..e4284c4c28 100644 --- a/code/web/interface/themes/responsive/Summon/summonDashboard.tpl +++ b/code/web/interface/themes/responsive/Summon/summonDashboard.tpl @@ -6,7 +6,7 @@
-

{translate text="Active Users" isAdminFacing=true}

+

{translate text="Active Users" isAdminFacing=true}

@@ -32,7 +32,7 @@
-

{translate text="Number of Records Viewed" isAdminFacing=true}

+

{translate text="Number of Records Viewed" isAdminFacing=true}

@@ -58,7 +58,7 @@
-

{translate text="Number of Records Clicked" isAdminFacing=true}

+

{translate text="Number of Records Clicked" isAdminFacing=true}

@@ -84,7 +84,7 @@
-

{translate text="Total Clicks" isAdminFacing=true}

+

{translate text="Total Clicks" isAdminFacing=true}