/
holdingsils.phtml
181 lines (178 loc) · 10.1 KB
/
holdingsils.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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<?
// Set up convenience variables:
$account = $this->auth()->getManager();
$user = $account->isLoggedIn();
$openUrl = $this->openUrl($this->driver, 'holdings');
$openUrlActive = $openUrl->isActive();
// Account for replace_other_urls setting
$urls = $this->record($this->driver)->getLinkDetails($openUrlActive);
$offlineMode = $this->ils()->getOfflineMode();
try {
$holdings = $this->driver->getRealTimeHoldings();
} catch (\VuFind\Exception\ILS $e) {
$holdings = [];
$offlineMode = 'ils-offline';
}
// Set page title.
$this->headTitle($this->translate('Holdings') . ': ' . $this->driver->getBreadcrumb());
?>
<?=$this->context($this)->renderInContext('librarycards/selectcard.phtml', array('user' => $this->auth()->isLoggedIn())); ?>
<?=($offlineMode == "ils-offline") ? $this->render('Helpers/ils-offline.phtml', ['offlineModeMsg' => 'ils_offline_holdings_message']) : ''?>
<? if (($this->ils()->getHoldsMode() == 'driver' && !empty($holdings)) || $this->ils()->getTitleHoldsMode() == 'driver'): ?>
<? if ($account->loginEnabled() && $offlineMode != 'ils-offline'): ?>
<? if (!$user): ?>
<div class="alert alert-info">
<a href="<?=$this->recordLink()->getTabUrl($this->driver, 'Holdings')?>?login=true&catalogLogin=true" data-lightbox><?=$this->transEsc("Login")?></a> <?=$this->transEsc("hold_login")?>
</div>
<? elseif (!$user->cat_username): ?>
<div class="alert alert-info">
<?=$this->translate("hold_profile_html", array('%%url%%' => $this->recordLink()->getTabUrl($this->driver, 'Holdings') . '?catalogLogin=true'))?>
</div>
<? endif; ?>
<? endif; ?>
<? endif; ?>
<? $holdingTitleHold = $this->driver->tryMethod('getRealTimeTitleHold'); if (!empty($holdingTitleHold)): ?>
<a class="placehold" data-lightbox title="<?=$this->transEsc('request_place_text')?>" href="<?=$this->recordLink()->getRequestUrl($holdingTitleHold)?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc('title_hold_place')?></a>
<? endif; ?>
<? if (!empty($urls) || $openUrlActive): ?>
<h3><?=$this->transEsc("Internet")?></h3>
<? if (!empty($urls)): ?>
<? foreach ($urls as $current): ?>
<a href="<?=$this->escapeHtmlAttr($this->proxyUrl($current['url']))?>"><?=$this->escapeHtml($current['desc'])?></a><br/>
<? endforeach; ?>
<? endif; ?>
<? if ($openUrlActive): ?><?=$openUrl->renderTemplate()?><? endif; ?>
<? endif; ?>
<? foreach ($holdings as $holding): ?>
<h3>
<? $locationText = $this->transEsc('location_' . $holding['location'], array(), $holding['location']); ?>
<? if (isset($holding['locationhref']) && $holding['locationhref']): ?>
<a href="<?=$holding['locationhref']?>" target="_blank"><?=$locationText?></a>
<? else: ?>
<?=$locationText?>
<? endif; ?>
</h3>
<table class="table table-striped" summary="<?=$this->transEsc('Holdings details from')?> <?=$this->transEsc($holding['location'])?>">
<? $callNos = $this->tab->getUniqueCallNumbers($holding['items']); if (!empty($callNos)): ?>
<tr>
<th><?=$this->transEsc("Call Number")?>: </th>
<td width="50%">
<? foreach ($callNos as $callNo): ?>
<? if ($this->callnumberHandler): ?>
<a href="<?=$this->url('alphabrowse-home') ?>?source=<?=$this->escapeHtmlAttr($this->callnumberHandler) ?>&from=<?=$this->escapeHtmlAttr($callNo) ?>"><?=$this->escapeHtml($callNo)?></a>
<? else: ?>
<?=$this->escapeHtml($callNo)?>
<? endif; ?>
<br />
<? endforeach; ?>
</td>
</tr>
<? endif; ?>
<? if (isset($holding['textfields'])): foreach ($holding['textfields'] as $textFieldName => $textFields): ?>
<tr>
<? // Translation for summary is a special case for backwards-compatibility ?>
<th><?=$textFieldName == 'summary' ? $this->transEsc("Volume Holdings") : $this->transEsc(ucfirst($textFieldName))?>:</th>
<td>
<? foreach ($textFields as $current): ?>
<?=$this->escapeHtml($current)?><br/>
<? endforeach; ?>
</td>
</tr>
<? endforeach; endif; ?>
<? foreach ($holding['items'] as $row): ?>
<?
// AJAX Check record?
$check = isset($row['check']) && $row['check'];
$checkStorageRetrievalRequest = isset($row['checkStorageRetrievalRequest']) && $row['checkStorageRetrievalRequest'];
$checkILLRequest = isset($row['checkILLRequest']) && $row['checkILLRequest'];
// AJAX block record?
$block = !$check && isset($row['addLink']) && $row['addLink'] === 'block';
$blockStorageRetrievalRequest = !$checkStorageRetrievalRequest && isset($row['addStorageRetrievalRequestLink']) && $row['addStorageRetrievalRequestLink'] === 'block';
$blockILLRequest = !$checkILLRequest && isset($row['addILLRequestLink']) && $row['addILLRequestLink'] === 'block';
?>
<? if (isset($row['barcode']) && $row['barcode'] != ""): ?>
<tr vocab="http://schema.org/" typeof="Offer">
<th><?=$this->transEsc("Copy")?> <?=$this->escapeHtml($row['number'])?></th>
<td>
<? if ($row['reserve'] == "Y"): ?>
<link property="availability" href="http://schema.org/InStoreOnly" />
<?=$this->transEsc("On Reserve - Ask at Circulation Desk")?><br />
<? endif; ?>
<? if (isset($row['use_unknown_message']) && $row['use_unknown_message']): ?>
<span class="text-muted"><?=$this->transEsc("status_unknown_message")?></span>
<? else: ?>
<? if ($row['availability']): ?>
<? /* Begin Available Items (Holds) */ ?>
<span class="text-success"><?=$this->transEsc("Available")?><link property="availability" href="http://schema.org/InStock" /></span>
<? if (!$block && isset($row['link']) && $row['link']): ?>
<a class="<?=$check ? 'checkRequest ' : ''?>placehold" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['link'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Hold" : "Place a Hold")?></a>
<? endif; ?>
<? if (!$blockStorageRetrievalRequest && isset($row['storageRetrievalRequestLink']) && $row['storageRetrievalRequestLink']): ?>
<a class="<?=$checkStorageRetrievalRequest ? 'checkStorageRetrievalRequest ' : ''?> placeStorageRetrievalRequest" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['storageRetrievalRequestLink'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($checkStorageRetrievalRequest ? "storage_retrieval_request_check_text" : "storage_retrieval_request_place_text")?></a>
<? endif; ?>
<? if (!$blockILLRequest && isset($row['ILLRequestLink']) && $row['ILLRequestLink']): ?>
<a class="<?=$checkILLRequest ? 'checkILLRequest ' : ''?>placeILLRequest" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['ILLRequestLink'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($checkILLRequest ? "ill_request_check_text" : "ill_request_place_text")?></a>
<? endif; ?>
<? else: ?>
<? /* Begin Unavailable Items (Recalls) */ ?>
<span class="text-danger"><?=$this->transEsc($row['status'])?><link property="availability" href="http://schema.org/OutOfStock" /></span>
<? if (isset($row['returnDate']) && $row['returnDate']): ?>– <span class="small"><?=$this->escapeHtml($row['returnDate'])?></span><? endif; ?>
<? if (isset($row['duedate']) && $row['duedate']): ?>
– <span class="small"><?=$this->transEsc("Due")?>: <?=$this->escapeHtml($row['duedate'])?></span>
<? endif; ?>
<? if (isset($row['requests_placed']) && $row['requests_placed'] > 0): ?>
<span><?=$this->transEsc("Requests")?>: <?=$this->escapeHtml($row['requests_placed'])?></span>
<? endif; ?>
<? if (!$block && isset($row['link']) && $row['link']): ?>
<a class="<?=$check ? 'checkRequest' : ''?> placehold" data-lightbox href="<?=$this->recordLink()->getRequestUrl($row['link'])?>"><i class="fa fa-flag" aria-hidden="true"></i> <?=$this->transEsc($check ? "Check Recall" : "Recall This")?></a>
<? endif; ?>
<? endif; ?>
<? if (isset($row['item_notes'])): ?>
<div class="item-notes">
<b><?=$this->transEsc("Item Notes")?>:</b>
<ul>
<? foreach ($row['item_notes'] as $item_note): ?>
<li><?=$this->escapeHtml($item_note) ?></li>
<? endforeach; ?>
</ul>
</div>
<? endif; ?>
<? endif; ?>
<? /* Embed item structured data: library, barcode, call number */ ?>
<? if ($row['location']): ?>
<meta property="seller" content="<?=$this->escapeHtmlAttr($row['location'])?>" />
<? endif; ?>
<? if ($row['barcode']): ?>
<meta property="serialNumber" content="<?=$this->escapeHtmlAttr($row['barcode'])?>" />
<? endif; ?>
<? if ($row['callnumber']): ?>
<meta property="sku" content="<?=$this->escapeHtmlAttr($row['callnumber'])?>" />
<? endif; ?>
<? /* Declare that the item is to be borrowed, not for sale */ ?>
<link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut" />
<link property="itemOffered" href="#record" />
</td>
</tr>
<? endif; ?>
<? endforeach; ?>
<? if (!empty($holding['purchase_history'])): ?>
<tr>
<th><?=$this->transEsc("Most Recent Received Issues")?>:</th>
<td>
<? foreach ($holding['purchase_history'] as $current): ?>
<?=$this->escapeHtml($current['issue'])?><br/>
<? endforeach; ?>
</td>
</tr>
<? endif; ?>
</table>
<? endforeach; ?>
<? $history = $this->driver->getRealTimeHistory(); ?>
<? if (is_array($history) && !empty($history)): ?>
<h3><?=$this->transEsc("Most Recent Received Issues")?></h3>
<table class="table table-striped">
<? foreach ($history as $row): ?>
<tr><td><?=$this->escapeHtml($row['issue'])?></td></tr>
<? endforeach; ?>
</table>
<? endif; ?>