Bugzilla – Attachment 137980 Details for
Bug 27272
Move C4::Items::GetItemsInfo to Koha namespace
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27272: Remove GetItemsInfo from virtualshelves/sendshelf.pl
Bug-27272-Remove-GetItemsInfo-from-virtualshelvess.patch (text/plain), 6.74 KB, created by
Jonathan Druart
on 2022-07-21 14:05:21 UTC
(
hide
)
Description:
Bug 27272: Remove GetItemsInfo from virtualshelves/sendshelf.pl
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-21 14:05:21 UTC
Size:
6.74 KB
patch
obsolete
>From c2f45e4673174b933c4406ab44f93935a9da2cce Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 3 Jun 2022 08:33:00 +0200 >Subject: [PATCH] Bug 27272: Remove GetItemsInfo from > virtualshelves/sendshelf.pl > >And GetItemsLocationInfo from shelves.pl >--- > .../en/modules/virtualshelves/sendshelf.tt | 8 +++++--- > .../prog/en/modules/virtualshelves/shelves.tt | 18 ++++++++++++------ > virtualshelves/sendshelf.pl | 5 ++--- > virtualshelves/shelves.pl | 5 ++--- > 4 files changed, 21 insertions(+), 15 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >index 81567cb9806..caeeacca892 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelf.tt >@@ -1,4 +1,6 @@ > [% USE raw %] >+[% USE AuthorisedValues %] >+[% USE Branches %] > <SUBJECT> > Your list: [% shelfname | $raw %] > <END_SUBJECT> >@@ -144,12 +146,12 @@ Your list: [% shelfname | $raw %] > In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber | html %] > </p> > [% END %] >- [% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %] >+ [% IF ( BIBLIO_RESULT.ITEM_RESULTS.count ) %] > <p>Items: > <ul> > [% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]<li> >- [% ITEM_RESULT.branchname | $raw %] >- [% ITEM_RESULT.location | $raw %] >+ [% Branches.GetName(ITEM_RESULT.holdingbranch) | $raw %] >+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => ITEM_RESULT.location ) | html %]%] > [% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber | $raw %])[% END %] > [% ITEM_RESULT.barcode | $raw %] > </li>[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 356f801614f..6984b804df7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -2,6 +2,8 @@ > [% USE Asset %] > [% USE Koha %] > [% USE KohaDates %] >+[% USE AuthorisedValues %] >+[% USE Branches %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title> >@@ -315,7 +317,7 @@ > [% IF ( itemsloo.notforloan ) %] > <span class="noholdstext">No holds allowed</span> > [% ELSE %] >- [% IF ( itemsloo.ITEM_RESULTS.size ) %] >+ [% IF ( itemsloo.ITEM_RESULTS.count ) %] > <a id="reserve_[% itemsloo.biblionumber | html %]" href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | html %]">Holds</a> > [% IF ( holdfor ) %] <span class="holdforlink">| <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber | uri %]&findborrower=[% holdfor_patron.cardnumber | uri %]">Place hold for [% INCLUDE 'patron-title.inc' patron => holdfor_patron no_title => 1 %]</a></span>[% END %] > [% ELSE %] >@@ -334,12 +336,16 @@ > <td>[% itemsloo.dateadded | $KohaDates%]</td> > <td> > <ul> >- [% FOREACH result IN itemsloo.ITEM_RESULTS %] >+ [% FOREACH item IN itemsloo.ITEM_RESULTS %] > <li> >- [% result.holdingbranch | html %] >- [% IF ( result.location_intranet ) %]<span class="shelvingloc">[% result.location_intranet | html %]</span>[% END %] >- [% IF ( result.itemcallnumber ) %] >- [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% result.itemcallnumber |uri %]%22">[% result.itemcallnumber | html %]</a>] >+ [% Branches.GetName(item.holdingbranch) | html %] >+ [% IF ( item.location ) %] >+ <span class="shelvingloc"> >+ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.location', authorised_value => item.location ) | html %] >+ </span> >+ [% END %] >+ [% IF ( item.itemcallnumber ) %] >+ [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% item.itemcallnumber | uri %]%22">[% item.itemcallnumber | html %]</a>] > [% END %] > </li> > [% END %] >diff --git a/virtualshelves/sendshelf.pl b/virtualshelves/sendshelf.pl >index 0bcb43cea1e..4000192b3be 100755 >--- a/virtualshelves/sendshelf.pl >+++ b/virtualshelves/sendshelf.pl >@@ -29,7 +29,6 @@ use C4::Biblio qw( > GetMarcISBN > GetMarcSubjects > ); >-use C4::Items qw( GetItemsInfo ); > use C4::Output qw( > output_html_with_http_headers > output_and_exit >@@ -83,13 +82,13 @@ if ($to_address) { > my $marcauthorsarray = $biblio->get_marc_authors; > my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); > >- my @items = GetItemsInfo($biblionumber); >+ my $items = $biblio->items; > > $dat->{ISBN} = GetMarcISBN($record, $marcflavour); > $dat->{MARCSUBJCTS} = $marcsubjctsarray; > $dat->{MARCAUTHORS} = $marcauthorsarray; > $dat->{'biblionumber'} = $biblionumber; >- $dat->{ITEM_RESULTS} = \@items; >+ $dat->{ITEM_RESULTS} = $items; > $dat->{HASAUTHORS} = $dat->{'author'} || @$marcauthorsarray; > > $iso2709 .= $record->as_usmarc(); >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index eb5e77461f4..fa92cfcd6eb 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -28,7 +28,6 @@ use C4::Koha qw( > GetNormalizedOCLCNumber > GetNormalizedUPC > ); >-use C4::Items qw( GetItemsLocationInfo ); > use C4::Members; > use C4::Output qw( pagination_bar output_html_with_http_headers ); > use C4::XSLT qw( XSLTParse4Display ); >@@ -323,8 +322,8 @@ if ( $op eq 'view' ) { > } > > # Getting items infos for location display >- my @items_infos = &GetItemsLocationInfo( $biblionumber ); >- $this_item->{'ITEM_RESULTS'} = \@items_infos; >+ my $items = $biblio->items; >+ $this_item->{'ITEM_RESULTS'} = $items; > $this_item->{biblionumber} = $biblionumber; > push @items, $this_item; > } >-- >2.25.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 27272
:
128230
|
128231
|
135640
|
135641
|
135642
|
135643
|
135644
|
135645
|
135646
|
135647
|
135648
|
135649
|
135650
|
135651
|
135652
|
135653
|
135654
|
135655
|
135656
|
135657
|
135658
|
135659
|
137966
|
137967
|
137968
|
137969
|
137970
|
137971
|
137972
|
137973
|
137974
|
137975
|
137976
|
137977
|
137978
|
137979
|
137980
|
137981
|
137982
|
138109
|
138296
|
138297
|
138298
|
138303
|
138304
|
138305
|
138306
|
138307
|
138308
|
138437
|
138438
|
138439
|
138440
|
138441
|
138442
|
138553
|
138554
|
138555
|
138556
|
138557
|
138558
|
138559
|
138560
|
138561
|
138562
|
138563
|
138564
|
138565
|
138566
|
138567
|
138568
|
138569
|
138570
|
138571
|
138572
|
138573
|
138574
|
138575
|
138614
|
138615
|
138616
|
138617
|
138618
|
138619
|
138620
|
138621
|
138622
|
138623
|
138624
|
138625
|
138626
|
138627
|
138628
|
138629
|
138630
|
138631
|
138632
|
138633
|
138634
|
138635
|
138636
|
138714
|
138715
|
138716
|
138717
|
138718
|
138719
|
138720
|
138721
|
138722
|
138723
|
138724
|
138725
|
138726
|
138727
|
138728
|
138729
|
138730
|
138731
|
138732
|
138733
|
138734
|
138735
|
138736
|
138773
|
138774
|
138775
|
138776
|
138777
|
138778
|
138779
|
138780
|
138781
|
138782
|
138783
|
138784
|
138785
|
138786
|
138787
|
138788
|
138789
|
138790
|
138791
|
138792
|
138793
|
138794
|
138832
|
139928