Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 604: Show all subjects in dashboards #605

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions resources/admin/classes/common/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
";
Expand Down Expand Up @@ -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
";

Expand Down
11 changes: 5 additions & 6 deletions resources/ajax_htmldata/getDashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
echo "<thead><tr>";
echo "<th>" . _("Name") . "</th>";
echo "<th>" . _("Resource Type") . "</th>";
echo "<th>" . _("Subject") . "</th>";
echo "<th>" . _("General Subjects") . "</th>";
echo "<th>" . _("Detailed Subjects") . "</th>";
echo "<th>" . _("Acquisition Type") . "</th>";
echo "<th>" . _("Library number") . "</th>";
echo "<th>" . _("Payment amount") . "</th>";
Expand All @@ -33,16 +34,14 @@
echo "<tr>";
echo '<td><a href="resource.php?resourceID=' . $result['resourceID'] . '">' . $result['titleText'] . "</a></td>";
echo "<td>" . $result['resourceType'] . "</td>";
$subject = $result['generalSubject'] && $result['detailedSubject'] ?
$result['generalSubject'] . " / " . $result['detailedSubject'] :
$result['generalSubject'] . $result['detailedSubject'];
echo "<td>" . $subject . "</td>";
echo "<td>" . $result['generalSubjects'] . "</td>";
echo "<td>" . $result['detailedSubjects'] . "</td>";
echo "<td>" . $result['acquisitionType'] . "</td>";
echo "<td>" . $result['libraryNumber'] . "</td>";
echo "<td>" . $result['paymentAmount'] . "</td>";
echo "</tr>";
} else {
echo "<tr><td colspan='5'><b>";
echo "<tr><td colspan='6'><b>";
if ($i == $count) { echo _("Total"); } else { echo _("Sub-Total:") . " " . $result[$groupBy]; }
echo "</b></td>";
echo "<td><b>" . $result['paymentAmount'] . "</b></td>";
Expand Down
11 changes: 5 additions & 6 deletions resources/ajax_htmldata/getDashboardYearlyCosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
echo "<thead><tr>";
echo "<th>" . _("Name") . "</th>";
echo "<th>" . _("Resource Type") . "</th>";
echo "<th>" . _("Subject") . "</th>";
echo "<th>" . _("General Subjects") . "</th>";
echo "<th>" . _("Detailed Subjects") . "</th>";
echo "<th>" . _("Acquisition Type") . "</th>";
echo "<th>" . _("Library Number") . "</th>";
for ($i = $startYear; $i <= $endYear; $i++) {
Expand All @@ -45,10 +46,8 @@
echo "<tr>";
echo '<td><a href="resource.php?resourceID=' . $result['resourceID'] . '">' . $result['titleText'] . "</a></td>";
echo "<td>" . $result['resourceType'] . "</td>";
$subject = $result['generalSubject'] && $result['detailedSubject'] ?
$result['generalSubject'] . " / " . $result['detailedSubject'] :
$result['generalSubject'] . $result['detailedSubject'];
echo "<td>" . $subject . "</td>";
echo "<td>" . $result['generalSubjects'] . "</td>";
echo "<td>" . $result['detailedSubjects'] . "</td>";
echo "<td>" . $result['acquisitionType'] . "</td>";
echo "<td>" . $result['libraryNumber'] . "</td>";
for ($i = $startYear; $i <= $endYear; $i++) {
Expand All @@ -59,7 +58,7 @@
}
echo "</tr>";
} else {
echo "<tr><td colspan='5'><b>";
echo "<tr><td colspan='6'><b>";
if ($currentCount == $count) { echo _("Total"); } else { echo _("Sub-Total:") . " " . $result[$groupBy]; }
echo "</b></td>";
for ($i = $startYear; $i <= $endYear; $i++) {
Expand Down