From ac1e91b9f68a504e656ff1f36d589bfc0f47a98b 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 df7f4e66305ef8958883cc8fb13bc8bcd530fd45 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 45df2b1c01104ea55f1de606cd3a9daac82713f8 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 d566a24b82aaf275e2876255d1229ce6f67d16a2 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 f4e3363d3ab11eccf8c8b3f98dc86495d2a4125e 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 50ee85a8e7ca08517006ec9d03733a30c6b5af6a 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 398e94eff2ea2aac31b4fab6857479eaed735b35 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 91eca42dc4371bbf55f7a2dbbf8ed3b94af64307 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 cd9b1bd6707ede163070616942374ce6688b4753 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 54e764c9656d7866ed4c2ff099fd2dbe142122d6 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 b5b5fbc98745b94dd61336c9ebb73122ab95b324 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 c258fc8ca04094bde58b3592f28779eeff1d067a 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 3bb5d57c0e6d17229df141b9d48277301e304a1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9=20Zermatten?= Date: Mon, 29 Jul 2024 15:54:05 +0100 Subject: [PATCH 14/15] docs: update changelog --- code/web/release_notes/24.08.00.MD | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/web/release_notes/24.08.00.MD b/code/web/release_notes/24.08.00.MD index a5982213fc..631b1c34d9 100644 --- a/code/web/release_notes/24.08.00.MD +++ b/code/web/release_notes/24.08.00.MD @@ -103,6 +103,10 @@ To generate the passkey file, the following command should be run (as root): // other +// chloe +### Other Updates +- 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 - Mark Noble (MDN) @@ -117,6 +121,7 @@ To generate the passkey file, the following command should be run (as root): - Pedro Amorim (PA) - Alexander Blanchard (AB) - Jacob O'Mara (JOM) + - Chloe Zermatten (CZ) - Theke Solutions - Lucas Montoya (LM) \ No newline at end of file From 3adcb79684ac40b46b3a0d1a9f4e59ce126c1902 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}