Bugzilla – Attachment 164372 Details for
Bug 33568
Use the REST API to display items on the staff biblio detail view
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33568: serialitem => serial_item
Bug-33568-serialitem--serialitem.patch (text/plain), 4.42 KB, created by
Jonathan Druart
on 2024-04-03 07:42:09 UTC
(
hide
)
Description:
Bug 33568: serialitem => serial_item
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-04-03 07:42:09 UTC
Size:
4.42 KB
patch
obsolete
>From cab289e7634d941a159a7ae797373721f0b98909 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 28 Mar 2024 11:42:03 -0300 >Subject: [PATCH] Bug 33568: serialitem => serial_item >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >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> >--- > Koha/Item.pm | 6 +++--- > Koha/Schema/Result/Item.pm | 7 +++++++ > api/v1/swagger/definitions/item.yaml | 2 +- > api/v1/swagger/paths/biblios.yaml | 2 +- > .../html_helpers/tables/items/catalogue_detail.inc | 4 ++-- > 5 files changed, 14 insertions(+), 7 deletions(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index aa242188764..0a955df7e5c 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -470,13 +470,13 @@ sub checkout { > return Koha::Checkout->_new_from_dbic( $checkout_rs ); > } > >-=head3 serialitem >+=head3 serial_item > > =cut > >-sub serialitem { >+sub serial_item { > my ( $self ) = @_; >- my $rs = $self->_result->serialitem; >+ my $rs = $self->_result->serial_item; > return unless $rs; > return Koha::Serial::Item->_new_from_dbic($rs); > } >diff --git a/Koha/Schema/Result/Item.pm b/Koha/Schema/Result/Item.pm >index 84a0bb84055..cc428b0a837 100644 >--- a/Koha/Schema/Result/Item.pm >+++ b/Koha/Schema/Result/Item.pm >@@ -1062,6 +1062,13 @@ __PACKAGE__->might_have( > { cascade_copy => 0, cascade_delete => 0 }, > ); > >+__PACKAGE__->might_have( >+ "serial_item", >+ "Koha::Schema::Result::Serialitem", >+ { "foreign.itemnumber" => "self.itemnumber" }, >+ { cascade_copy => 0, cascade_delete => 0 }, >+); >+ > use C4::Context; > sub effective_itemtype { > my ( $self ) = @_; >diff --git a/api/v1/swagger/definitions/item.yaml b/api/v1/swagger/definitions/item.yaml >index e74dc1b90f8..e70ef75ecc7 100644 >--- a/api/v1/swagger/definitions/item.yaml >+++ b/api/v1/swagger/definitions/item.yaml >@@ -246,7 +246,7 @@ properties: > type: > - object > - "null" >- serialitem: >+ serial_item: > type: > - object > - "null" >diff --git a/api/v1/swagger/paths/biblios.yaml b/api/v1/swagger/paths/biblios.yaml >index 24d64d0ed41..10b2b42820b 100644 >--- a/api/v1/swagger/paths/biblios.yaml >+++ b/api/v1/swagger/paths/biblios.yaml >@@ -446,7 +446,7 @@ > - analytics_count > - cover_image_ids > - item_group_item.item_group.description >- - serialitem.serial >+ - serial_item.serial > collectionFormat: csv > - $ref: "../swagger.yaml#/parameters/match" > - $ref: "../swagger.yaml#/parameters/order_by" >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 5526d903fb4..b1c599653a2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -217,7 +217,7 @@ > embed.push('item_group_item.item_group.description'); > [% END %] > [% IF biblio.serial %] >- embed.push('serialitem.serial'); >+ embed.push('serial_item.serial'); > [% END %] > [% IF Koha.Preference('UseRecalls') %] > embed.push('recall', 'recall+strings', 'recall.patron') >@@ -428,7 +428,7 @@ > render: function (data, type, row, meta) { > 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; >+ let serial = row.serial_item ? row.serial_item.serial : null; > if ( row.serial_issue_number && serial && serial.serialseq ) { > nodes += '<span class="enum">%s</span>'.format(escape_str(row.serial_issue_number)); > if ( serial.serialseq && row.serial_issue_number != serial.serialseq ) { >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33568
:
151339
|
153791
|
164308
|
164309
|
164310
|
164311
|
164312
|
164313
|
164314
|
164315
|
164316
|
164317
|
164318
|
164319
|
164320
|
164321
|
164322
|
164323
|
164324
|
164325
|
164326
|
164327
|
164328
|
164329
|
164330
|
164331
|
164332
|
164333
|
164334
|
164335
|
164336
|
164337
|
164338
|
164339
|
164340
|
164341
|
164342
|
164343
|
164344
|
164345
|
164346
|
164347
|
164348
|
164349
|
164350
|
164351
|
164352
|
164353
|
164354
|
164355
|
164356
|
164358
|
164359
|
164360
|
164361
|
164362
|
164363
|
164364
|
164365
|
164366
|
164367
|
164368
|
164369
|
164370
|
164371
|
164372
|
164373
|
164374
|
164472
|
164480
|
164482
|
164483
|
164485
|
164528