Skip to content
Snippets Groups Projects
Commit 0e05e935 authored by Ere Maijala's avatar Ere Maijala Committed by Robert Lange
Browse files

Improve display of electronic items from Alma. (#1509)

parent 40f6c305
No related merge requests found
......@@ -1722,15 +1722,30 @@ class Alma extends AbstractBase implements \VuFindHttp\HttpServiceAwareInterface
$avail = $this->getMarcSubfield($field, 'e');
$item = $tmpl;
$item['availability'] = strtolower($avail) === 'available';
$item['location'] = $this->getMarcSubfield($field, 'm');
// Using subfield 't' ('Interface name') as callnumber
// Use the following subfields for location:
// m (Collection name)
// i (Available for library)
// d (Available for library)
// b (Available for library)
$location = [
$this->getMarcSubfield($field, 'm') ?: 'Get full text'
];
foreach (['i', 'd', 'b'] as $code) {
if ($content = $this->getMarcSubfield($field, $code)) {
$location[] = $content;
}
}
$item['location'] = implode(' - ', $location);
$item['callnumber'] = $this->getMarcSubfield($field, 't');
$url = $this->getMarcSubfield($field, 'u');
if (preg_match('/^https?:\/\//', $url)) {
$item['locationhref'] = $url;
}
$item['status'] = $this->getMarcSubfield($field, 's');
$item['callnumber'] = $this->getMarcSubfield($field, 'd');
$item['status'] = $this->getMarcSubfield($field, 's')
?: null;
if ($note = $this->getMarcSubfield($field, 'n')) {
$item['item_notes'] = [$note];
}
$status[] = $item;
}
// Digital
......
......@@ -18,6 +18,16 @@
<?php else: ?>
<span class="text-danger"><?=$this->transEsc($item['status'])?></span>
<?php endif; ?>
<?php if (isset($item['item_notes'])): ?>
<div class="item-notes">
<b><?=$this->transEsc("Item Notes")?>:</b>
<ul>
<?php foreach ($item['item_notes'] as $item_note): ?>
<li><?=$this->escapeHtml($item_note) ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
</td>
</tr>
<?php endforeach; ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment