Fix display of downloads
This commit is contained in:
@@ -85,11 +85,12 @@ class User extends DbMapping
|
|||||||
|
|
||||||
private function _getCirculations($table, $sort = "ItemNr ASC") {
|
private function _getCirculations($table, $sort = "ItemNr ASC") {
|
||||||
$sql = sprintf("SELECT
|
$sql = sprintf("SELECT
|
||||||
NoticeID,
|
n.NoticeNr,
|
||||||
CheckOutDate,
|
CheckOutDate,
|
||||||
ItemNr
|
ItemNr
|
||||||
FROM %s AS c
|
FROM %s AS c
|
||||||
INNER JOIN Items AS i ON i.ItemId = c.ItemId
|
INNER JOIN Items AS i ON i.ItemId = c.ItemId
|
||||||
|
INNER JOIN Notices AS n ON n.NoticeID = i.NoticeID
|
||||||
WHERE
|
WHERE
|
||||||
c.UserAccountID = %s
|
c.UserAccountID = %s
|
||||||
ORDER BY %s", $table, $this->id, $sort);
|
ORDER BY %s", $table, $this->id, $sort);
|
||||||
@@ -97,8 +98,10 @@ class User extends DbMapping
|
|||||||
$result = Connection::execute($sql);
|
$result = Connection::execute($sql);
|
||||||
|
|
||||||
$circulations = $result->to_array();
|
$circulations = $result->to_array();
|
||||||
$ids = array_map(function($c) { return $c['NoticeID']; }, $circulations);
|
// getting the intval of the NoticeNr will remove any 'V' or 'T' and thus we will have no issues with
|
||||||
$books = count($ids) > 0 ? BookSearch::GetBooks($ids, 'id') : array();
|
// the virtual books that are used for Downloads and so.
|
||||||
|
$codes = array_unique(array_map(function($c) { return intval(trim($c['NoticeNr'])); }, $circulations));
|
||||||
|
$books = count($codes) > 0 ? BookSearch::GetBooks($codes) : array();
|
||||||
|
|
||||||
foreach($circulations as $c) {
|
foreach($circulations as $c) {
|
||||||
$id = $c['NoticeID'];
|
$id = $c['NoticeID'];
|
||||||
|
|||||||
Reference in New Issue
Block a user