diff --git a/module/VuFind/src/VuFind/RecordTab/HoldingsILS.php b/module/VuFind/src/VuFind/RecordTab/HoldingsILS.php index cc089fe8b6aae0ee8c930b4018f3d5339cca6e11..321ad317bd52a1078ddb4c9fce3f4a8f5b0d34d4 100644 --- a/module/VuFind/src/VuFind/RecordTab/HoldingsILS.php +++ b/module/VuFind/src/VuFind/RecordTab/HoldingsILS.php @@ -67,6 +67,26 @@ class HoldingsILS extends AbstractBase return 'Holdings'; } + /** + * Support method used by template -- extract all unique call numbers from + * an array of items. + * + * @param array $items Items to search through. + * + * @return array + */ + public function getUniqueCallNumbers($items) + { + $callNos = array(); + foreach ($items as $item) { + if (isset($item['callnumber']) && strlen($item['callnumber']) > 0) { + $callNos[] = $item['callnumber']; + } + } + sort($callNos); + return array_unique($callNos); + } + /** * Is this tab active? * diff --git a/themes/blueprint/templates/RecordTab/holdingsils.phtml b/themes/blueprint/templates/RecordTab/holdingsils.phtml index 79e862bd3f57c3689618fc41dac1e331e84cd5d6..96f806653b4db815ddc0f89f2423d86e1b279979 100644 --- a/themes/blueprint/templates/RecordTab/holdingsils.phtml +++ b/themes/blueprint/templates/RecordTab/holdingsils.phtml @@ -48,10 +48,14 @@ <? foreach ($holdings as $location => $holding): ?> <h3><?=$this->transEsc($location)?></h3> <table cellpadding="2" cellspacing="0" border="0" class="citation" summary="<?=$this->transEsc('Holdings details from')?> <?=$this->transEsc($location)?>"> - <? if (isset($holding['items'][0]['callnumber'])): ?> + <? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?> <tr> <th><?=$this->transEsc("Call Number")?>: </th> - <td><?=$this->escapeHtml($holding['items'][0]['callnumber'])?></td> + <td> + <? foreach ($callNos as $callNo): ?> + <?=$this->escapeHtml($callNo)?><br /> + <? endforeach; ?> + </td> </tr> <? endif; ?> <? if (!empty($holding['summary'])): ?> diff --git a/themes/jquerymobile/templates/RecordTab/holdingsils.phtml b/themes/jquerymobile/templates/RecordTab/holdingsils.phtml index 66f3848768af9603bd6219b10b2fd145f26e7187..f1b6549a583def0b1a0b7c19753a2b3f7e24835a 100644 --- a/themes/jquerymobile/templates/RecordTab/holdingsils.phtml +++ b/themes/jquerymobile/templates/RecordTab/holdingsils.phtml @@ -36,10 +36,14 @@ <? foreach ($holdings as $location => $holding): ?> <h4><?=$this->transEsc($location)?></h4> <table class="holdings" summary="<?=$this->transEsc('Holdings details from')?> <?=$this->transEsc($location)?>"> - <? if (isset($holding['items'][0]['callnumber'])): ?> + <? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?> <tr> <th><?=$this->transEsc("Call Number")?>: </th> - <td><?=$this->escapeHtml($holding['items'][0]['callnumber'])?></td> + <td> + <? foreach ($callNos as $callNo): ?> + <?=$this->escapeHtml($callNo)?><br /> + <? endforeach; ?> + </td> </tr> <? endif; ?> <? if (!empty($holding['summary'])): ?>