Bug 33568: enumchron/volinfo
Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Laurence Rault <laurence.rault@biblibre.com> Signed-off-by: Emily Lamancusa <emily.lamancusa@montgomerycountymd.gov> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
parent
869336f98e
commit
c071b1ec25
6 changed files with 55 additions and 8 deletions
12
Koha/Item.pm
12
Koha/Item.pm
|
@ -51,6 +51,7 @@ use Koha::Plugins;
|
||||||
use Koha::Recalls;
|
use Koha::Recalls;
|
||||||
use Koha::Result::Boolean;
|
use Koha::Result::Boolean;
|
||||||
use Koha::SearchEngine::Indexer;
|
use Koha::SearchEngine::Indexer;
|
||||||
|
use Koha::Serial::Items;
|
||||||
use Koha::StockRotationItem;
|
use Koha::StockRotationItem;
|
||||||
use Koha::StockRotationRotas;
|
use Koha::StockRotationRotas;
|
||||||
use Koha::TrackedLinks;
|
use Koha::TrackedLinks;
|
||||||
|
@ -444,6 +445,17 @@ sub checkout {
|
||||||
return Koha::Checkout->_new_from_dbic( $checkout_rs );
|
return Koha::Checkout->_new_from_dbic( $checkout_rs );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
=head3 serialitem
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub serialitem {
|
||||||
|
my ( $self ) = @_;
|
||||||
|
my $rs = $self->_result->serialitem;
|
||||||
|
return unless $rs;
|
||||||
|
return Koha::Serial::Item->_new_from_dbic($rs);
|
||||||
|
}
|
||||||
|
|
||||||
=head3 item_group
|
=head3 item_group
|
||||||
|
|
||||||
my $item_group = $item->item_group;
|
my $item_group = $item->item_group;
|
||||||
|
|
|
@ -302,6 +302,7 @@ sub get_items {
|
||||||
|
|
||||||
my $items_rs = $biblio->items;
|
my $items_rs = $biblio->items;
|
||||||
$items_rs = $items_rs->filter_by_bookable if $bookable_only;
|
$items_rs = $items_rs->filter_by_bookable if $bookable_only;
|
||||||
|
# FIXME We need to order_by serial.publisheddate if we have _order_by=+me.serial_issue_number
|
||||||
my $items = $c->objects->search($items_rs);
|
my $items = $c->objects->search($items_rs);
|
||||||
return $c->render(
|
return $c->render(
|
||||||
status => 200,
|
status => 200,
|
||||||
|
|
|
@ -24,6 +24,8 @@ use Koha::Database;
|
||||||
|
|
||||||
use base qw(Koha::Object);
|
use base qw(Koha::Object);
|
||||||
|
|
||||||
|
use Koha::Serials;
|
||||||
|
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
Koha::Serial::Item - Koha Serial Item Object class
|
Koha::Serial::Item - Koha Serial Item Object class
|
||||||
|
@ -34,6 +36,17 @@ Koha::Serial::Item - Koha Serial Item Object class
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
||||||
|
=head3 serial
|
||||||
|
|
||||||
|
=cut
|
||||||
|
|
||||||
|
sub serial {
|
||||||
|
my ($self) = @_;
|
||||||
|
my $rs = $self->_result->serialid;
|
||||||
|
return unless $rs;
|
||||||
|
return Koha::Serial->_new_from_dbic($rs);
|
||||||
|
}
|
||||||
|
|
||||||
=head3 type
|
=head3 type
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
|
|
@ -238,6 +238,10 @@ properties:
|
||||||
type:
|
type:
|
||||||
- object
|
- object
|
||||||
- "null"
|
- "null"
|
||||||
|
serialitem:
|
||||||
|
type:
|
||||||
|
- object
|
||||||
|
- "null"
|
||||||
_strings:
|
_strings:
|
||||||
type:
|
type:
|
||||||
- object
|
- object
|
||||||
|
|
|
@ -425,6 +425,7 @@
|
||||||
- +strings
|
- +strings
|
||||||
- cover_image_ids
|
- cover_image_ids
|
||||||
- item_group_item.item_group.description
|
- item_group_item.item_group.description
|
||||||
|
- serialitem.serial
|
||||||
collectionFormat: csv
|
collectionFormat: csv
|
||||||
- $ref: "../swagger.yaml#/parameters/match"
|
- $ref: "../swagger.yaml#/parameters/match"
|
||||||
- $ref: "../swagger.yaml#/parameters/order_by"
|
- $ref: "../swagger.yaml#/parameters/order_by"
|
||||||
|
|
|
@ -712,9 +712,7 @@
|
||||||
<th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
|
<th id="[% tab | html %]_item_group" data-colname="[% tab | html %]_item_group">Item group</th>
|
||||||
[% END %]
|
[% END %]
|
||||||
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
|
<th id="[% tab | html %]_itemcallnumber" data-colname="[% tab | html %]_itemcallnumber">Call number</th>
|
||||||
[% IF volinfo %]
|
<th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
|
||||||
<th id="[% tab | html %]_enumchron" data-colname="[% tab | html %]_enumchron">Serial enumeration / chronology</th>
|
|
||||||
[% END %]
|
|
||||||
<th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
|
<th id="[% tab | html %]_status" data-colname="[% tab | html %]_status">Status</th>
|
||||||
<th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
|
<th id="[% tab | html %]_lastseen" data-colname="[% tab | html %]_lastseen">Last seen</th>
|
||||||
<th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
|
<th id="[% tab | html %]_issues" data-colname="[% tab | html %]_issues">Checkouts</th>
|
||||||
|
@ -2498,6 +2496,9 @@
|
||||||
[% IF Koha.Preference('EnableItemGroups') %]
|
[% IF Koha.Preference('EnableItemGroups') %]
|
||||||
embed.push('item_group_item.item_group.description');
|
embed.push('item_group_item.item_group.description');
|
||||||
[% END %]
|
[% END %]
|
||||||
|
[% IF biblio.serial %]
|
||||||
|
embed.push('serialitem.serial');
|
||||||
|
[% END %]
|
||||||
let table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %];
|
let table_settings = [% TablesSettings.GetTableSettings('catalogue', 'detail','holdings_table','json') | $raw %];
|
||||||
var items_table = $("#table_items").kohaTable({
|
var items_table = $("#table_items").kohaTable({
|
||||||
ajax: { url: table_url },
|
ajax: { url: table_url },
|
||||||
|
@ -2631,17 +2632,32 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
[% IF volinfo %]
|
|
||||||
{
|
{
|
||||||
data: "",
|
data: "me.serial_issue_number",
|
||||||
className: "enumchron",
|
className: "enumchron",
|
||||||
searchable: false, // FIXME
|
searchable: true,
|
||||||
orderable: true,
|
orderable: true,
|
||||||
render: function (data, type, row, meta) {
|
render: function (data, type, row, meta) {
|
||||||
return "volinfo"; // FIXME volinfo/enumchron/serial_issue_number
|
let nodes = "";
|
||||||
|
[%# FIXME Previously we displayed the column if at least one item of the biblio had an enumchron/serial_issue_number. Now it's only if one item of the ones displayed on the current page, how is that bad? How can it be fixed in an elegant way? Should we display the column only if biblio.serial? %]
|
||||||
|
let serial = row.serialitem ? row.serialitem.serial : null;
|
||||||
|
if ( row.serial_issue_number && serial && serial.serialseq ) {
|
||||||
|
nodes += '<span class="enum">%s</span>'.format(row.serial_issue_number);
|
||||||
|
if ( serial.serialseq && row.serial_issue_number != serial.serialseq ) {
|
||||||
|
nodes += ' <span class="sep"> -- </span>'
|
||||||
|
nodes += ' <span class="serialseq">%s</span>'.format(serial.serialseq);
|
||||||
|
}
|
||||||
|
} else if ( row.serial_issue_number ) {
|
||||||
|
nodes += ' <span class="enum">%s</span>'.format(row.serial_issue_number);
|
||||||
|
} else if ( serial && serial.serialseq ) {
|
||||||
|
nodes += '<span class="serialseq">%s</span>'.format(serial.serialseq);
|
||||||
|
}
|
||||||
|
if ( serial && serial.publisheddate ) {
|
||||||
|
nodes += ' <span class="pubdate">(%s)</span>'.format($date(serial.publisheddate));
|
||||||
|
}
|
||||||
|
return nodes;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[% END %]
|
|
||||||
{
|
{
|
||||||
data: "",
|
data: "",
|
||||||
className: "status",
|
className: "status",
|
||||||
|
|
Loading…
Reference in a new issue