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

Display status of item locations by status priority. #3758

Open
wants to merge 22 commits into
base: dev-11.0
Choose a base branch
from
Open
Changes from 2 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2e917b0
Display status of item locations by status priority.
GrothTobias Jun 6, 2024
9c07778
Removed unneeded code
GrothTobias Jun 6, 2024
4d74ee2
Refactored display of item locations in the results
GrothTobias Jun 21, 2024
8cf1ee9
Reverted return values of AvailabilityStatus::availabilityAsString. A…
GrothTobias Jul 8, 2024
cc13f9d
Code styling
GrothTobias Jul 8, 2024
f257af4
Code styling
GrothTobias Jul 8, 2024
5fc5bac
Fixed results-scripts.phtml for theme bootstrap3
GrothTobias Jul 8, 2024
92b5022
Fixed availability display
GrothTobias Aug 12, 2024
0a56e68
Merge branch 'dev' into item-status-location-by-priority
demiankatz Sep 5, 2024
04ee7cf
Added 'status-uncertain' icons to js-icons.phtml
GrothTobias Sep 6, 2024
239c360
Fix broken tests.
demiankatz Sep 6, 2024
cfaa055
Return location list's icons and classes in ajax response.
GrothTobias Sep 9, 2024
2c46f8e
Removed unused 'availabilityClasses' declaration from check_item_stat…
GrothTobias Sep 9, 2024
34cc7be
Server side rendering of location list and callnumbers.
GrothTobias Sep 13, 2024
3f6a1fb
Fixed code style
GrothTobias Sep 13, 2024
c3d3ef6
Fixed code styling
GrothTobias Sep 13, 2024
cc00199
code style fix
GrothTobias Sep 13, 2024
264487b
Revert unwanted changes
GrothTobias Sep 23, 2024
47d57da
Refactored pickValue() to return an array. Use associative array for …
GrothTobias Oct 4, 2024
4d5522b
Added changes to bootstrap3 theme. Fixed code styling.
GrothTobias Oct 4, 2024
72ad7e4
Fixed code styling.
GrothTobias Oct 4, 2024
d1711b7
Fixed code styling.
GrothTobias Oct 4, 2024
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
23 changes: 10 additions & 13 deletions module/VuFind/src/VuFind/AjaxHandler/GetItemStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -330,22 +330,12 @@ protected function getItemStatusGroup($record, $callnumberSetting)
// Summarize call number, location and availability info across all items:
$locations = [];
foreach ($record as $info) {
$availabilityStatus = $info['availability'];
// Find an available copy
if ($availabilityStatus->isAvailable()) {
if ('true' !== ($locations[$info['location']]['available'] ?? null)) {
$locations[$info['location']]['available'] = $availabilityStatus->getStatusDescription();
}
}
// Check for a use_unknown_message flag
if ($availabilityStatus->is(AvailabilityStatusInterface::STATUS_UNKNOWN)) {
$locations[$info['location']]['status_unknown'] = true;
}
// Store call number/location info:
$locations[$info['location']]['callnumbers'][] = $this->formatCallNo(
$info['callnumber_prefix'] ?? '',
$info['callnumber']
);
$locations[$info['location']]['items'][] = $info;
}

// Build list split out by location:
Expand All @@ -362,16 +352,23 @@ protected function getItemStatusGroup($record, $callnumberSetting)
$callnumberSetting,
'Multiple Call Numbers'
);

// Get combined availability for location
$locationStatus = $this->availabilityStatusManager->combine($details['items']);
$locationAvailability = $locationStatus['availability'];

$locationInfo = [
'availability' => $details['available'] ?? false,
'availability' =>
GrothTobias marked this conversation as resolved.
Show resolved Hide resolved
$locationAvailability->is(AvailabilityStatusInterface::STATUS_AVAILABLE),
'location' => htmlentities(
$this->translateWithPrefix('location_', $location),
ENT_COMPAT,
'UTF-8'
),
'callnumbers' =>
htmlentities($locationCallnumbers, ENT_COMPAT, 'UTF-8'),
'status_unknown' => $details['status_unknown'] ?? false,
'status_unknown' =>
$locationAvailability->is(AvailabilityStatusInterface::STATUS_UNKNOWN),
'callnumber_handler' => $callnumberHandler,
];
$locationList[] = $locationInfo;
Expand Down
Loading