copies = copies.merge(units);
END;
END;
+available=ctx.available;
FOREACH copy_info IN copies;
IF copy_info.call_number_label != '##URI##';
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;
%]
+
[% use_courses = (ctx.get_org_setting(ctx.aou_tree.id, 'circ.course_materials_opt_in') == 1) ? 1 : 0 %]
[% IF ctx.geo_sort %]
<form method="GET">
</form>
[% END %]
[% END %]
+
+<div>
+[% IF available == 'true'; %]
+ <a href="[% mkurl('', {available => 'false' }) %]">
+ Show All Copies
+ </a>
+[% END; %]
+
+[% IF available == 'false'; %]
+ <a href="[% mkurl('', {available => 'true' }) %]">
+ Show Only Available Copies
+ </a>
+[% END; %]
+
<table class="table_no_border_space table_no_cell_pad table_no_border" width="100%" id="rdetails_status">
<thead>
<tr>
</thead>
<tbody class="copy_details_table">
[%- FOREACH peer IN ctx.foreign_copies;
- FOREACH bib IN peer.foreign_copy_maps; %]
- <tr class="copy_details_row"><td>
- [%- bib_lib_name = ctx.get_aou(bib.target_copy.circ_lib).name | html;
- l("[_1] (foreign item)", bib_lib_name); -%]
- <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_author">[% peer.author | html %]</span>
- </a>
- </li></ul>
- </td>
- <td>[% bib.target_copy.call_number.label | html %]</td>
- <td>[% bib.target_copy.barcode | html %]</td>
- <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 use_courses %]
- <td></td>
- [%- END %]
- [%- IF ctx.geo_sort && ctx.has_valid_coords %]
- <td>[% display_ou_distance(bib.target_copy.circ_lib) %]</td>
- [%- END %]
-</tr>
+ FOREACH bib IN peer.foreign_copy_maps; %]
+ <tr class="copy_details_row"><td>
+ [%- bib_lib_name = ctx.get_aou(bib.target_copy.circ_lib).name | html;
+ l("[_1] (foreign item)", bib_lib_name); -%]
+ <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_author">[% peer.author | html %]</span>
+ </a>
+ </li></ul>
+ </td>
+ <td>[% bib.target_copy.call_number.label | html %]</td>
+ <td>[% bib.target_copy.barcode | html %]</td>
+ <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 use_courses %]
+ <td></td>
+ [%- END %]
+ [%- 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
-%]
END;
-%]
<tr class="copy_details_offers_row" property="offers" typeof="Offer">
- [%- IF serial_holdings %]<td class='rdetail-issue-issue'>
- [%- copy_info.holding_label | html; -%]
- </td>
- [%- ELSE %]<td>
- [%- INCLUDE "opac/parts/library_name_link.tt2"; -%]
- <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',
- {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>
- [%- END %]
- <td property="serialNumber">
- [% copy_info.barcode | html -%]
- [% 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)
- OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
- <span> | </span>
- <a href="javascript:;" onclick='window.open("[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]/edit", "_blank");'>[% l('edit') %]</a>
+ [%- IF serial_holdings %]<td class='rdetail-issue-issue'>
+ [%- copy_info.holding_label | html; -%]
+ </td>
+ [%- ELSE %]<td>
+ [%- INCLUDE "opac/parts/library_name_link.tt2"; -%]
+ <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',
+ {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>
+ [%- END %]
+ <td property="serialNumber">
+ [% copy_info.barcode | html -%]
+ [% 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)
+ OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
+ <span> | </span>
+ <a href="javascript:;" onclick='window.open("[% ctx.base_path %]/staff/cat/item/[% copy_info.id %]/edit", "_blank");'>[% l('edit') %]</a>
+ [% END %]
+ [% ELSE %]
+ <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)
+ OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
+ <span> | </span>
+ <a href="javascript:;"
+ onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
+ [% l(' edit') %]
+ </a>
+ [% END %]
[% END %]
- [% ELSE %]
- <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)
- OR ctx.has_perm('UPDATE_COPY', copy_info.call_number_owning_lib) %]
- <span> | </span>
- <a href="javascript:;"
- onclick="xulG.volume_item_creator({copy_id : [% copy_info.id %]})">
- [% l(' edit') %]
- </a>
[% END %]
- [% END %]
- [% END %]
- [%- IF attrs.gtin13;
- '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />';
- END; -%]
- </td>
- <td property="availableAtOrFrom">[%- INCLUDE "opac/parts/location_name_link.tt2"; -%]</td>
- [% IF copy_info.courses.size > 0 || ctx.is_staff %]
- <td>[% copy_info.circ_modifier | html %]</td>
- [% ELSIF 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>[%
- 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),
- DATE_FORMAT
+ [%- IF attrs.gtin13;
+ '<meta property="gtin13" content="' _ attrs.gtin13 _ '" />';
+ END; -%]
+ </td>
+ <td property="availableAtOrFrom">[%- INCLUDE "opac/parts/location_name_link.tt2"; -%]</td>
+
+ [% IF copy_info.courses.size > 0 || ctx.is_staff %]
+ <td>[% copy_info.circ_modifier | html %]</td>
+ [% ELSIF use_courses %]
+ <td></td>
+ [% END %]
+ [% IF ctx.is_staff %]
+ <td>[% copy_info.circ_modifier | html %]</td>
+ <td>
+ [% copy_info.age_protect ?
+ ctx.get_crahp(copy_info.age_protect).name : l('None') | html %]
+ </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),
+ DATE_FORMAT
+ );
+ ELSE;
+ '-';
+ END;
+ %]</td>
+ [% END # is_staff %]
+ [% IF ctx.is_staff OR serial_holdings %]
+ <td>[% # Show copy/volume hold links to staff (without
+ # checking whether they have permissions to do those).
+ overall_holdable = (
+ copy_info.holdable == 't' AND
+ copy_info.location_holdable == 't' AND
+ copy_info.status_holdable == 't'
);
- ELSE;
- '-';
- END;
- %]</td>
- [% END # is_staff %]
- [% IF ctx.is_staff OR serial_holdings %]
- <td>[% # Show copy/volume hold links to staff (without
- # checking whether they have permissions to do those).
- overall_holdable = (
- copy_info.holdable == 't' AND
- copy_info.location_holdable == 't' AND
- copy_info.status_holdable == 't'
- );
- IF overall_holdable;
- hold_link = '';
- param_sep = l(" / ");
+ IF overall_holdable;
+ hold_link = '';
+ param_sep = l(" / ");
- # Only staff get to place copy or volume holds
- IF ctx.is_staff;
- hold_link = '<a href="' _
- mkurl(ctx.opac_root _ '/place_hold', {
- hold_target => copy_info.id,
- hold_type => 'C',
- hold_source_page => mkurl()
- }) _ '">' _ l('Copy hold') _ '</a>';
- IF copy_info.call_number != last_cn;
- last_cn = copy_info.call_number;
- hold_link = hold_link _ param_sep;
- hold_link = hold_link _ '<a href="' _
+ # Only staff get to place copy or volume holds
+ IF ctx.is_staff;
+ hold_link = '<a href="' _
mkurl(ctx.opac_root _ '/place_hold', {
- hold_target => copy_info.call_number,
- hold_type => 'V',
+ hold_target => copy_info.id,
+ hold_type => 'C',
hold_source_page => mkurl()
- }) _ '">' _ l('Volume hold') _ '</a>';
- END;
- IF serial_holdings;
- hold_link = hold_link _ param_sep;
+ }) _ '">' _ l('Copy hold') _ '</a>';
+ IF copy_info.call_number != last_cn;
+ last_cn = copy_info.call_number;
+ hold_link = hold_link _ param_sep;
+ hold_link = hold_link _ '<a href="' _
+ mkurl(ctx.opac_root _ '/place_hold', {
+ hold_target => copy_info.call_number,
+ hold_type => 'V',
+ hold_source_page => mkurl()
+ }) _ '">' _ l('Volume hold') _ '</a>';
+ END;
+ IF serial_holdings;
+ hold_link = hold_link _ param_sep;
+ END;
+ END;
+ IF serial_holdings;
+ hold_link = hold_link _
+ '<a class="rdetail-issue-place-hold" href="' _
+ mkurl(ctx.opac_root _ '/place_hold', {
+ hold_target => copy_info.issuance,
+ hold_type => 'I',
+ hold_source_page => mkurl()
+ }) _ '" rel="nofollow" vocab="">' _ l('Issue hold') _ '</a>';
END;
- END;
- IF serial_holdings;
- hold_link = hold_link _
- '<a class="rdetail-issue-place-hold" href="' _
- mkurl(ctx.opac_root _ '/place_hold', {
- hold_target => copy_info.issuance,
- hold_type => 'I',
- hold_source_page => mkurl()
- }) _ '" rel="nofollow" vocab="">' _ l('Issue hold') _ '</a>';
- END;
-
- hold_link;
- ELSE;
- l("Not holdable");
- END %]</td>
- [%- END %]
- <td>[%-
- schema_copy_status.${copy_info.status_code};
- copy_info.copy_status | html;
- -%]</td>
- <td>[%
- IF copy_info.due_date;
- date.format(
- ctx.parse_datetime(copy_info.due_date, copy_info.circ_circ_lib),
- DATE_FORMAT
- );
- ELSE;
- '-';
- END %]</td>
- [%- IF 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>
+ hold_link;
+ ELSE;
+ l("Not holdable");
+ END %]</td>
+ [%- END %]
+ <td>[%-
+ schema_copy_status.${copy_info.status_code};
+ copy_info.copy_status | html;
+ -%]</td>
+ <td>[%
+ IF copy_info.due_date;
+ date.format(
+ ctx.parse_datetime(copy_info.due_date, copy_info.circ_circ_lib),
+ DATE_FORMAT
+ );
+ ELSE;
+ '-';
+ END %]</td>
+ [%- IF 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; %]
[% FOREACH note IN copy_info.notes; %]
<tr><td> </td><td class="copy_note" colspan="4" property="description"><strong>[% note.title | html %]:</strong> [% note.value | html %]</td></tr>
</td></tr>
[%- END; # FOR copy_info
%]
- <tr>
[%- 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 %]
[%- END %]
</tbody>
</table>
+</div>
[% END; %]