From fe07597197f48ec45e3101a03b3a0a34a19cec81 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Mon, 30 Sep 2019 15:31:41 +0200 Subject: [PATCH] Issue 604: Show all subjects in dashboards --- resources/admin/classes/common/Dashboard.php | 8 ++++---- resources/ajax_htmldata/getDashboard.php | 11 +++++------ resources/ajax_htmldata/getDashboardYearlyCosts.php | 11 +++++------ 3 files changed, 14 insertions(+), 16 deletions(-) diff --git a/resources/admin/classes/common/Dashboard.php b/resources/admin/classes/common/Dashboard.php index 6cca5195a..2c3f9116c 100644 --- a/resources/admin/classes/common/Dashboard.php +++ b/resources/admin/classes/common/Dashboard.php @@ -9,8 +9,8 @@ public function getQuery($resourceTypeID, $year, $acquisitionTypeID, $orderTypeI AT.shortName AS acquisitionType, OT.shortName AS orderType, CD.shortName AS costDetails, - GS.shortName AS generalSubject, - DS.shortName AS detailedSubject, + GROUP_CONCAT(DISTINCT GS.shortName) AS generalSubjects, + GROUP_CONCAT(DISTINCT DS.shortName) AS detailedSubjects, RA.libraryNumber AS libraryNumber, SUM(ROUND(COALESCE(RP.paymentAmount, 0) / 100, 2)) as paymentAmount "; @@ -55,8 +55,8 @@ public function getQueryYearlyCosts($resourceTypeID, $startYear, $endYear, $acqu RT.shortName AS resourceType, AT.shortName AS acquisitionType, CD.shortName AS costDetails, - GS.shortName AS generalSubject, - DS.shortName AS detailedSubject, + GROUP_CONCAT(DISTINCT GS.shortName) AS generalSubjects, + GROUP_CONCAT(DISTINCT DS.shortName) AS detailedSubjects, RA.libraryNumber AS libraryNumber "; diff --git a/resources/ajax_htmldata/getDashboard.php b/resources/ajax_htmldata/getDashboard.php index 5279eab9a..5ae76513d 100644 --- a/resources/ajax_htmldata/getDashboard.php +++ b/resources/ajax_htmldata/getDashboard.php @@ -20,7 +20,8 @@ echo ""; echo "" . _("Name") . ""; echo "" . _("Resource Type") . ""; - echo "" . _("Subject") . ""; + echo "" . _("General Subjects") . ""; + echo "" . _("Detailed Subjects") . ""; echo "" . _("Acquisition Type") . ""; echo "" . _("Library number") . ""; echo "" . _("Payment amount") . ""; @@ -33,16 +34,14 @@ echo ""; echo '' . $result['titleText'] . ""; echo "" . $result['resourceType'] . ""; - $subject = $result['generalSubject'] && $result['detailedSubject'] ? - $result['generalSubject'] . " / " . $result['detailedSubject'] : - $result['generalSubject'] . $result['detailedSubject']; - echo "" . $subject . ""; + echo "" . $result['generalSubjects'] . ""; + echo "" . $result['detailedSubjects'] . ""; echo "" . $result['acquisitionType'] . ""; echo "" . $result['libraryNumber'] . ""; echo "" . $result['paymentAmount'] . ""; echo ""; } else { - echo ""; + echo ""; if ($i == $count) { echo _("Total"); } else { echo _("Sub-Total:") . " " . $result[$groupBy]; } echo ""; echo "" . $result['paymentAmount'] . ""; diff --git a/resources/ajax_htmldata/getDashboardYearlyCosts.php b/resources/ajax_htmldata/getDashboardYearlyCosts.php index 0383e9a90..dcaab5c5c 100644 --- a/resources/ajax_htmldata/getDashboardYearlyCosts.php +++ b/resources/ajax_htmldata/getDashboardYearlyCosts.php @@ -27,7 +27,8 @@ echo ""; echo "" . _("Name") . ""; echo "" . _("Resource Type") . ""; - echo "" . _("Subject") . ""; + echo "" . _("General Subjects") . ""; + echo "" . _("Detailed Subjects") . ""; echo "" . _("Acquisition Type") . ""; echo "" . _("Library Number") . ""; for ($i = $startYear; $i <= $endYear; $i++) { @@ -45,10 +46,8 @@ echo ""; echo '' . $result['titleText'] . ""; echo "" . $result['resourceType'] . ""; - $subject = $result['generalSubject'] && $result['detailedSubject'] ? - $result['generalSubject'] . " / " . $result['detailedSubject'] : - $result['generalSubject'] . $result['detailedSubject']; - echo "" . $subject . ""; + echo "" . $result['generalSubjects'] . ""; + echo "" . $result['detailedSubjects'] . ""; echo "" . $result['acquisitionType'] . ""; echo "" . $result['libraryNumber'] . ""; for ($i = $startYear; $i <= $endYear; $i++) { @@ -59,7 +58,7 @@ } echo ""; } else { - echo ""; + echo ""; if ($currentCount == $count) { echo _("Total"); } else { echo _("Sub-Total:") . " " . $result[$groupBy]; } echo ""; for ($i = $startYear; $i <= $endYear; $i++) {