-
Notifications
You must be signed in to change notification settings - Fork 350
/
standard.phtml
106 lines (106 loc) · 6.18 KB
/
standard.phtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?php if ($this->holdings()->holdingIsVisible($holding)): ?>
<?php
$check = $holding['check'] ?? false;
$checkStorageRetrievalRequest = $holding['checkStorageRetrievalRequest'] ?? false;
$checkILLRequest = $holding['checkILLRequest'] ?? false;
$availabilityStatus = $holding['availability'];
?>
<tr class="holding-row"<?=$this->schemaOrg()->getAttributes(['vocab' => 'http://schema.org/', 'typeof' => 'Offer'])?>>
<th class="copy-number"><?=$this->transEsc('Copy')?> <?=$this->escapeHtml($holding['number'])?>
<?php if ($holding['enumchron'] ?? false): ?>
<span class="enumchron">(<?=$this->escapeHtml($holding['enumchron'])?>)</span>
<?php endif; ?>
</th>
<td>
<?php if ($holding['reserve'] == 'Y'): ?>
<?=$this->schemaOrg()->getLink('http://schema.org/InStoreOnly', 'availability')?>
<?=$this->transEsc('On Reserve - Ask at Circulation Desk')?><br>
<?php endif; ?>
<?php
$statusClass = $this->availabilityStatus()->getClass($availabilityStatus);
$statusDescription = $availabilityStatus->getStatusDescription();
$statusDescriptionTokens = $availabilityStatus->getStatusDescriptionTokens();
$schemaAvailabilityUri = $availabilityStatus->getSchemaAvailabilityUri();
?>
<span class="<?=$this->escapeHtmlAttr($statusClass)?>">
<?=$this->transEsc($statusDescription, $statusDescriptionTokens)?>
<?php if ($schemaAvailabilityUri): ?>
<?=$this->schemaOrg()->getLink($schemaAvailabilityUri, 'availability')?>
<?php endif; ?>
</span>
<?php if ($availabilityStatus->isAvailable()): ?>
<?php /* Begin Available Items (Holds) */ ?>
<?php if ($holding['link'] ?? false): ?>
<a class="<?=$check ? 'checkRequest request-check ' : ''?>placehold icon-link" <?php if (!empty($holding['linkLightbox'])): ?>data-lightbox <?php endif; ?>href="<?=$this->escapeHtmlAttr($this->recordLinker()->getRequestUrl($holding['link']))?>">
<?=$this->icon('place-hold', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc($check ? 'Check Hold' : 'Place a Hold')?></span>
</a>
<?php endif; ?>
<?php if ($holding['storageRetrievalRequestLink'] ?? false): ?>
<a class="<?=$checkStorageRetrievalRequest ? 'checkStorageRetrievalRequest request-check ' : ''?> placeStorageRetrievalRequest icon-link" data-lightbox href="<?=$this->escapeHtmlAttr($this->recordLinker()->getRequestUrl($holding['storageRetrievalRequestLink']))?>">
<?=$this->icon('place-storage-retrieval', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc($checkStorageRetrievalRequest ? 'storage_retrieval_request_check_text' : 'storage_retrieval_request_place_text')?></span>
</a>
<?php endif; ?>
<?php if ($holding['ILLRequestLink'] ?? false): ?>
<a class="<?=$checkILLRequest ? 'checkILLRequest request-check ' : ''?>placeILLRequest icon-link" data-lightbox href="<?=$this->escapeHtmlAttr($this->recordLinker()->getRequestUrl($holding['ILLRequestLink']))?>">
<?=$this->icon('place-ill-request', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc($checkILLRequest ? 'ill_request_check_text' : 'ill_request_place_text')?></span>
</a>
<?php endif; ?>
<?php else: ?>
<?php /* Begin Unavailable Items (Recalls) */ ?>
<?php if ($holding['returnDate'] ?? false): ?>– <span class="small"><?=$this->escapeHtml($holding['returnDate'])?></span><?php endif; ?>
<?php if ($holding['duedate'] ?? false): ?>
– <span class="small"><?=$this->transEsc('Due')?>: <?=$this->escapeHtml($holding['duedate'])?></span>
<?php endif; ?>
<?php if (($holding['requests_placed'] ?? 0) > 0): ?>
<span><?=$this->transEsc('Requests')?>: <?=$this->escapeHtml($holding['requests_placed'])?></span>
<?php endif; ?>
<?php if ($holding['link'] ?? false): ?>
<a class="<?=$check ? 'checkRequest request-check ' : ''?>placehold icon-link" <?php if (!empty($holding['linkLightbox'])): ?>data-lightbox <?php endif; ?>href="<?=$this->escapeHtmlAttr($this->recordLinker()->getRequestUrl($holding['link']))?>">
<?=$this->icon('place-recall', 'icon-link__icon') ?>
<span class="icon-link__label"><?=$this->transEsc($check ? 'Check Recall' : 'Recall This')?></span>
</a>
<?php endif; ?>
<?=$this->relais()->renderButtonIfActive($this->driver ?? null)?>
<?php endif; ?>
<?php if (isset($holding['item_notes'])): ?>
<div class="item-notes">
<b><?=$this->transEsc('Item Notes')?>:</b>
<ul>
<?php foreach ($holding['item_notes'] as $item_note): ?>
<li><?=$this->escapeHtml($item_note) ?></li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>
<?php if (!empty($holding['bound_with_records'])): ?>
<?=
$this->render(
'RecordTab/holdingsils/boundwith.phtml',
[
'boundWithRecords' => $holding['bound_with_records'],
'callNumber' => $holding['callnumber'],
'callNumberCount' => count($callNos),
'driver' => $driver,
]
);
?>
<?php endif; ?>
<?php /* Embed item structured data: library, barcode, call number */ ?>
<?php if ($holding['location'] ?? false): ?>
<?=$this->schemaOrg()->getMeta('seller', $holding['location'])?>
<?php endif; ?>
<?php if ($holding['barcode'] ?? false): ?>
<?=$this->schemaOrg()->getMeta('serialNumber', $holding['barcode'])?>
<?php endif; ?>
<?php if ($holding['callnumber'] ?? false): ?>
<?=$this->schemaOrg()->getMeta('sku', $holding['callnumber'])?>
<?php endif; ?>
<?php /* Declare that the item is to be borrowed, not for sale */ ?>
<?=$this->schemaOrg()->getLink('http://purl.org/goodrelations/v1#LeaseOut', 'businessFunction')?>
<?=$this->schemaOrg()->getLink('#record', 'itemOffered')?>
</td>
</tr>
<?php endif; ?>