Bugzilla – Attachment 61973 Details for
Bug 17843
Move C4::Koha::getitemtypeinfo to Koha::ItemTypes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17843: Remove C4::Koha::getitemtypeinfo
Bug-17843-Remove-C4Kohagetitemtypeinfo.patch (text/plain), 3.30 KB, created by
Lari Taskula
on 2017-04-07 10:54:12 UTC
(
hide
)
Description:
Bug 17843: Remove C4::Koha::getitemtypeinfo
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2017-04-07 10:54:12 UTC
Size:
3.30 KB
patch
obsolete
>From 101eb07312da731d72064e674cd41424e261e9ef Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 4 Jan 2017 10:32:26 +0100 >Subject: [PATCH] Bug 17843: Remove C4::Koha::getitemtypeinfo > >At this point there should not be any calls to this subroutine. > >Signed-off-by: Lari Taskula <lari.taskula@jns.fi> >--- > C4/Koha.pm | 40 ---------------------------------------- > t/db_dependent/Koha.t | 8 +------- > 2 files changed, 1 insertion(+), 47 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 6932293..f547fe0 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -41,7 +41,6 @@ BEGIN { > @ISA = qw(Exporter); > @EXPORT = qw( > &GetPrinters &GetPrinter >- &getitemtypeinfo > &GetItemTypesCategorized > &getallthemes > &getFacets >@@ -121,45 +120,6 @@ sub GetItemTypesCategorized { > return ($dbh->selectall_hashref($query,'itemtype')); > } > >-=head2 getitemtypeinfo >- >- $itemtype = &getitemtypeinfo($itemtype, [$interface]); >- >-Returns information about an itemtype. The optional $interface argument >-sets which interface ('opac' or 'intranet') to return the imageurl for. >-Defaults to intranet. >- >-=cut >- >-sub getitemtypeinfo { >- my ($itemtype, $interface) = @_; >- my $dbh = C4::Context->dbh; >- require C4::Languages; >- my $language = C4::Languages::getlanguage(); >- my $it = $dbh->selectrow_hashref(q| >- SELECT >- itemtypes.itemtype, >- itemtypes.description, >- itemtypes.rentalcharge, >- itemtypes.notforloan, >- itemtypes.imageurl, >- itemtypes.summary, >- itemtypes.checkinmsg, >- itemtypes.checkinmsgtype, >- itemtypes.sip_media_type, >- COALESCE( localization.translation, itemtypes.description ) AS translated_description >- FROM itemtypes >- LEFT JOIN localization ON itemtypes.itemtype = localization.code >- AND localization.entity = 'itemtypes' >- AND localization.lang = ? >- WHERE itemtypes.itemtype = ? >- |, undef, $language, $itemtype ); >- >- $it->{imageurl} = getitemtypeimagelocation( ( ( defined $interface && $interface eq 'opac' ) ? 'opac' : 'intranet' ), $it->{imageurl} ); >- >- return $it; >-} >- > =head2 getitemtypeimagedir > > my $directory = getitemtypeimagedir( 'opac' ); >diff --git a/t/db_dependent/Koha.t b/t/db_dependent/Koha.t >index b3f51e0..635f57c 100644 >--- a/t/db_dependent/Koha.t >+++ b/t/db_dependent/Koha.t >@@ -9,7 +9,7 @@ use Koha::DateUtils qw(dt_from_string); > use Koha::AuthorisedValue; > use Koha::AuthorisedValueCategories; > >-use Test::More tests => 7; >+use Test::More tests => 6; > use DateTime::Format::MySQL; > > BEGIN { >@@ -151,12 +151,6 @@ subtest 'Authorized Values Tests' => sub { > > }; > >-subtest 'Itemtype info Tests' => sub { >- like ( getitemtypeinfo('BK')->{'imageurl'}, qr/intranet-tmpl/, 'getitemtypeinfo on unspecified interface returns intranet imageurl (legacy behavior)' ); >- like ( getitemtypeinfo('BK', 'intranet')->{'imageurl'}, qr/intranet-tmpl/, 'getitemtypeinfo on "intranet" interface returns intranet imageurl' ); >- like ( getitemtypeinfo('BK', 'opac')->{'imageurl'}, qr/opac-tmpl/, 'getitemtypeinfo on "opac" interface returns opac imageurl' ); >-}; >- > ### test for C4::Koha->GetDailyQuote() > SKIP: > { >-- >2.7.4
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 17843
:
58583
|
58584
|
61972
|
61973
|
62266
|
62267
|
64400
|
64401
|
64582
|
64583
|
64584