END;
END;
-%]
+[%- MACRO display_ou_distance(ou) BLOCK;
+ km = ctx.ou_distances.$ou;
+ IF km && km != '-1';
+ IF ctx.get_org_setting(ctx.physical_loc || ctx.search_ou, 'opac.geographic_proximity_in_miles');
+ distance = l('[_1] mi', POSIX.sprintf('%.01f', km / 1.609));
+ ELSE;
+ distance = l('[_1] km', POSIX.sprintf('%.01f', km));
+ END;
+ ELSE;
+ distance = '-';
+ END;
+%]
+[% distance %]
+[%- END %]
[%-
IF has_copies or ctx.foreign_copies;
depth = CGI.param('copy_depth').defined ? CGI.param('copy_depth') : CGI.param('depth').defined ? CGI.param('depth') : ctx.copy_summary.last.depth;
total_copies = ctx.copy_summary.$depth.count;
%]
-<table class="container-fluid table table-hover mt-4 miniTable copyTable" width="100%" >
+[% IF ctx.geo_sort %]
+<form method="GET">
+[% FOREACH p IN CGI.params.keys; NEXT IF p == 'geographic-location' %]
+ <input type="hidden" name="[% p | html %]" value="[% CGI.params.$p | html %]"/>
+[% END %]
+<span with="50%">
+ [% l("Sort by distance from:") %]
+ <input type="text" id="geographic-location-box" name="geographic-location" aria-label="[% l('Enter address or postal code') %]" placeholder="[% l('Enter address/postal code') %]" class="search-box" x-webkit-speech="" value="[% p = 'geographic-location'; CGI.params.$p %]"></input>
+ <button type="submit" class="btn btn-confirm">[% l('Go') %]</button>
+</span>
+[% p = 'geographic-location'; IF CGI.params.$p && !ctx.has_valid_coords %]
+<span class="opac-alert">[% l('Sorry, your address is not recognized') %]</span>
+[% END %]
+</form>
+[% p = 'geographic-location'; IF CGI.params.$p && ctx.has_valid_coords %]
+<form method="GET">
+[% FOREACH p IN CGI.params.keys; NEXT IF p == 'geographic-location' %]
+ <input type="hidden" name="[% p | html %]" value="[% CGI.params.$p | html %]"/>
+[% END %]
+ <button type="submit" class="opac-button">[% l('Use default item sort') %]</button>
+</form>
+[% END %]
+[% END %]
+<table class="container-fluid table table-hover mt-4 miniTable copyTable w-100" >
<thead>
<tr>
[% IF serial_holdings -%]
[%- END %]
<th scope='col'>[% l("Barcode") %]</th>
<th scope='col'>[% l("Shelving Location") %]</th>
- [%- IF ctx.is_staff %]
+ [%- IF ctx.is_staff || ctx.use_courses %]
<th scope='col'>[% l("Circulation Modifier") %]</th>
+ [%- END %]
+ [%- IF ctx.is_staff %]
<th scope='col'>[% l("Age Hold Protection") %]</th>
<th scope='col'>[% l("Active/Create Date") %]</th>
[%- END %]
[%- END %]
<th scope='col'>[% l("Status") %]</th>
<th scope='col'>[% l("Due Date") %]</th>
+ [%- IF ctx.use_courses %]
+ <th scope='col'>[% l("Courses") %]</th>
+ [%- END %]
+ [%- IF ctx.geo_sort && ctx.has_valid_coords %]
+ <th scope='col'>[% l("Distance") %]</th>
+ [%- END %]
</tr>
</thead>
<tbody>
<ul><li>
<span class="bib_peer_type">[% bib.peer_type.name | html %]</span>:
<a href="[% mkurl(ctx.opac_root _ '/record/' _ bib.target_copy.call_number.record) %]">
- <span class="bib_peer_title">[% peer.title | html %]</span> /
+ <span class="bib_peer_title">[% peer.title | html %]</span> /
<span class="bib_peer_author">[% peer.author | html %]</span>
</a>
</li></ul>
<td>[% bib.target_copy.location.name | html %]</td>
<td>[% bib.target_copy.status.name | html %]</td>
<td>[% date.format(ctx.parse_datetime(copy_info.due_date, copy_info.circ_circ_lib),DATE_FORMAT) %]</td>
+ [%- IF ctx.geo_sort && ctx.has_valid_coords %]
+ <td>[% display_ou_distance(bib.target_copy.circ_lib) %]</td>
+ [%- END %]
</tr>
[%- END; # FOREACH peer
END; # FOREACH bib
<link property="businessFunction" href="http://purl.org/goodrelations/v1#LeaseOut">
<meta property="price" content="0.00">
</td>[% END %]
- <td><span property="sku">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc')
- OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn',
+ <td><span property="sku">[% callnum | html %]</span> [% IF ctx.get_org_setting(CGI.param('loc')
+ OR ctx.aou_tree.id, 'sms.enable') == 1 %](<a href="[% mkurl(ctx.opac_root _ '/sms_cn',
{copy_id => copy_info.id}) %];rec=[%- ctx.bre_id -%]" rel="nofollow" vocab="">Text</a>)[% END %]</td>
[%- IF has_parts == 'true' %]
<td>[% copy_info.part_label | html %]</td>
[% IF ctx.is_staff %]
[%- IF ctx.is_browser_staff %]
<a target="_blank" href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]">[% l('view') %]</a>
- [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
+ [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
<span> | </span>
<a target="_blank" href="[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]/edit">[% l('edit') %]</a>
<a onclick="xulG.new_tab(xulG.urls.XUL_COPY_STATUS, {}, {'from_item_details_new': true, 'barcodes': ['[%- copy_info.barcode | html | replace('\'', '\\\'') -%]']})"
href="javascript:;">[% l('view') %]</a>
[%# if the user can edit copies, show the copy edit link %]
- [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
+ [% IF ctx.has_perm('UPDATE_COPY', copy_info.circ_lib)
OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
<span> | </span>
- <a href="javascript:;"
+ <a href="javascript:;"
onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
[% l(' edit') %]
</a>
END; -%]
</td>
<td property="availableAtOrFrom">[%- INCLUDE "opac/parts/location_name_link.tt2"; -%]</td>
- [%- IF ctx.is_staff %]
+ [% IF copy_info.courses.size > 0 || ctx.is_staff %]
<td>[% copy_info.circ_modifier | html %]</td>
+ [% ELSIF ctx.use_courses %]
+ <td></td>
+ [% END %]
+ [% IF ctx.is_staff %]
<td>
[% copy_info.age_protect ?
ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
</td>
- <td>[%
+ <td>[%
IF ctx.get_org_setting(copy_info.circ_lib, 'circ.holds.age_protect.active_date') == 1;
disp_date = copy_info.active_date ? copy_info.active_date : copy_info.create_date;
ELSE;
disp_date = copy_info.create_date;
END;
-
+
IF disp_date;
date.format(
ctx.parse_datetime(disp_date),
param_sep = l(" / ");
# Only staff get to place copy or volume holds
- IF ctx.is_staff;
+ IF ctx.is_staff;
hold_link = '<a href="' _
mkurl(ctx.opac_root _ '/place_hold', {
hold_target => copy_info.id,
hold_source_page => mkurl()
}) _ '">' _ l('Copy hold') _ '</a>';
IF copy_info.call_number != last_cn;
- last_cn = copy_info.call_number;
+ last_cn = copy_info.call_number;
hold_link = hold_link _ param_sep;
hold_link = hold_link _ '<a href="' _
mkurl(ctx.opac_root _ '/place_hold', {
IF serial_holdings;
hold_link = hold_link _ param_sep;
END;
- END;
- IF serial_holdings;
+ END;
+ IF serial_holdings;
hold_link = hold_link _
'<a class="rdetail-issue-place-hold" href="' _
mkurl(ctx.opac_root _ '/place_hold', {
hold_type => 'I',
hold_source_page => mkurl()
}) _ '" rel="nofollow" vocab="">' _ l('Issue hold') _ '</a>';
- END;
+ END;
hold_link;
- ELSE;
+ ELSE;
l("Not holdable");
END %]</td>
[%- END %]
ELSE;
'-';
END %]</td>
+ [%- IF ctx.use_courses %]
+ <td>[%- FOREACH course IN copy_info.courses %]
+ <div>[% course.course_number %]</div>
+ [% END %]</td>
+ [% END %]
+ [%- IF ctx.geo_sort && ctx.has_valid_coords %]
+ <td>[% display_ou_distance(copy_info.circ_lib) %]</td>
+ [%- END %]
</tr>
[% IF copy_info.notes; %]
[%- END; # FOR copy_info
%]
- [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
- new_offset = ctx.copy_offset - ctx.copy_limit;
- IF new_offset < 0; new_offset = 0; END %]
- [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
- <tr class="offset">
- [%- IF ctx.copy_offset > 0 AND NOT serial_holdings;
- new_offset = ctx.copy_offset - ctx.copy_limit;
- IF new_offset < 0; new_offset = 0; END %]
- <td>
+ [% IF ctx.copy_limit < total_copies AND NOT serial_holdings %]
+ <tr class="offset">
+ [%- IF ctx.copy_offset > 0;
+ new_offset = ctx.copy_offset - ctx.copy_limit;
+ IF new_offset < 0; new_offset = 0; END %]
+ <td>
<a href="[% mkurl('', {copy_offset => new_offset, copy_limit => ctx.copy_limit}) %]">« [%
l('Previous [_1]', ctx.copy_offset - new_offset) %]</a>
- </td>
- [%- END %]
- [%- IF copies.size >= ctx.copy_limit AND NOT serial_holdings AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
- <td>
- <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
+ </td>
+ [%- END %]
+ [%- IF copies.size >= ctx.copy_limit AND (ctx.copy_offset + ctx.copy_limit < total_copies) %]
+ <td>
+ <a href="[% mkurl('', {copy_offset => ctx.copy_offset + ctx.copy_limit, copy_limit => ctx.copy_limit}) %]">[%
l('Next [_1]', ctx.copy_limit) %] »</a>
- </td>
- [%- END %]
+ </td>
+ [%- END %]
</tr>
+ [% END %]
+
+ [% IF NOT serial_holdings -%]
+ [%- more_copies_limit = 50 %] [%# TODO: config %]
+ [%- IF ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
+ <tr class="not_serial">
+ <td>
+ <div class="rdetail_show_copies">
+ <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]"><i class="fas fa-plus-square"></i> [% l('Show more copies') %]</a>
+ </div>
+ </td>
+ </tr>
+ [%- ELSIF ctx.copy_limit == more_copies_limit %]
+ <tr class="not_serial">
+ <td>
+ <div class="rdetail_show_copies">
+ <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]"><i class="fas fa-minus-square"></i> [% l('Show fewer copies') %]</a>
+ </div>
+ </td>
+ </tr>
+ [%- END %]
[%- END %]
- [%- END %]
- [% IF NOT serial_holdings && ctx.copy_limit < total_copies -%]
- <tr class="not_serial">
- <td>
- [%- more_copies_limit = 50 %] [%# TODO: config %]
- [%- IF ctx.copy_limit != more_copies_limit AND copies.size >= ctx.copy_limit AND ctx.copy_limit < total_copies %]
- <div class="rdetail_show_copies">
- <img src="[% ctx.media_prefix %]/images/plus_sign.png[% ctx.cache_key %]" alt="[% l('Show more copies icon') %]"/>
- <a href="[% mkurl('', {copy_limit => more_copies_limit, copy_offset => 0}) %]">[% l('Show more copies') %]</a>
- </div>
- [%- ELSIF ctx.copy_limit == more_copies_limit %]
- <div class="rdetail_show_copies">
- <img src="[% ctx.media_prefix %]/images/minus_sign.png[% ctx.cache_key %]" alt="[% l('Show fewer copies icon') %]"/>
- <a href="[% mkurl('', {copy_limit => 0, copy_offset => 0}) %]">[% l('Show fewer copies') %]</a>
- </div>
- [%- END %]
- </td>
- </tr>
- [%- END %]
</tbody>
</table>
-[% END; %]
+[% END %]