Bugzilla – Attachment 137976 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 opac-sendbasket
Bug-27272-Remove-GetItemsInfo-from-opac-sendbasket.patch (text/plain), 6.38 KB, created by
Jonathan Druart
on 2022-07-21 14:04:50 UTC
(
hide
)
Description:
Bug 27272: Remove GetItemsInfo from opac-sendbasket
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2022-07-21 14:04:50 UTC
Size:
6.38 KB
patch
obsolete
>From e0757cfe3c5ebefb5124182f86a8619ea442bb43 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 3 Jun 2022 08:20:17 +0200 >Subject: [PATCH] Bug 27272: Remove GetItemsInfo from opac-sendbasket > >--- > .../opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt | 8 +++++--- > .../opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt | 8 +++++--- > opac/opac-sendbasket.pl | 8 ++------ > opac/opac-sendshelf.pl | 7 ++----- > 4 files changed, 14 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >index 00f93e7e0a7..38978d299a8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendbasket.tt >@@ -1,6 +1,8 @@ > [% USE raw %] > [% USE HtmlToText %] > [% USE Koha %] >+[% USE AuthorisedValues %] >+[% USE Branches %] > > <SUBJECT> > Your cart >@@ -143,12 +145,12 @@ Your cart > 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/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >index be952e23992..168dce74be8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-sendshelf.tt >@@ -1,4 +1,6 @@ > [% USE raw %] >+[% USE AuthorisedValues %] >+[% USE Branches %] > <SUBJECT> > Your list : [% shelfname | $raw %] > <END_SUBJECT> >@@ -145,12 +147,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/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl >index fcc49e0f7e6..7ce5f9fdab5 100755 >--- a/opac/opac-sendbasket.pl >+++ b/opac/opac-sendbasket.pl >@@ -27,7 +27,6 @@ use Try::Tiny qw( catch try ); > use C4::Biblio qw( > GetMarcSubjects > ); >-use C4::Items qw( GetItemsInfo ); > use C4::Auth qw( get_template_and_user ); > use C4::Output qw( output_html_with_http_headers ); > use C4::Templates; >@@ -49,8 +48,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( > my $bib_list = $query->param('bib_list') || ''; > my $email_add = $query->param('email_add'); > >-my $dbh = C4::Context->dbh; >- > if ( $email_add ) { > die "Wrong CSRF token" unless Koha::Token->new->check_csrf({ > session_id => scalar $query->cookie('CGISESSID'), >@@ -88,19 +85,18 @@ if ( $email_add ) { > my $marcauthorsarray = $biblio->get_marc_authors; > my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); > >- my @items = GetItemsInfo( $biblionumber ); >+ my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron }); > > my $hasauthors = 0; > if($dat->{'author'} || @$marcauthorsarray) { > $hasauthors = 1; > } >- > > $dat->{MARCSUBJCTS} = $marcsubjctsarray; > $dat->{MARCAUTHORS} = $marcauthorsarray; > $dat->{HASAUTHORS} = $hasauthors; > $dat->{'biblionumber'} = $biblionumber; >- $dat->{ITEM_RESULTS} = \@items; >+ $dat->{ITEM_RESULTS} = $items; > > $iso2709 .= $record->as_usmarc(); > >diff --git a/opac/opac-sendshelf.pl b/opac/opac-sendshelf.pl >index 915428111af..768e372b4f5 100755 >--- a/opac/opac-sendshelf.pl >+++ b/opac/opac-sendshelf.pl >@@ -30,7 +30,6 @@ use C4::Biblio qw( > GetMarcISBN > GetMarcSubjects > ); >-use C4::Items qw( GetItemsInfo ); > use C4::Output qw( output_html_with_http_headers ); > use Koha::Biblios; > use Koha::Email; >@@ -56,8 +55,6 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user ( > my $shelfid = $query->param('shelfid'); > my $email = $query->param('email'); > >-my $dbh = C4::Context->dbh; >- > my $shelf = Koha::Virtualshelves->find( $shelfid ); > if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { > if ( $email ) { >@@ -97,13 +94,13 @@ if ( $shelf and $shelf->can_be_viewed( $borrowernumber ) ) { > my $marcauthorsarray = $biblio->get_marc_authors; > my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); > >- my @items = GetItemsInfo( $biblionumber ); >+ my $items = $biblio->items->filter_by_visible_in_opac({ patron => $patron }); > > $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(); >-- >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