Bugzilla – Attachment 44126 Details for
Bug 5979
Add separate OPACISBD system preference
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 5979 - OPAC ISBD view has its own syspref
Bug-5979---OPAC-ISBD-view-has-its-own-syspref.patch (text/plain), 2.96 KB, created by
Alex Arnaud
on 2015-10-28 14:50:39 UTC
(
hide
)
Description:
Bug 5979 - OPAC ISBD view has its own syspref
Filename:
MIME Type:
Creator:
Alex Arnaud
Created:
2015-10-28 14:50:39 UTC
Size:
2.96 KB
patch
obsolete
>From 930c03b0065d218ce192fbce9afe09e281b760e0 Mon Sep 17 00:00:00 2001 >From: Alex Arnaud <alex.arnaud@biblibre.com> >Date: Wed, 28 Oct 2015 15:49:28 +0100 >Subject: [PATCH] Bug 5979 - OPAC ISBD view has its own syspref > >--- > C4/Biblio.pm | 3 ++- > t/Biblio/Isbd.t | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ > 2 files changed, 52 insertions(+), 1 deletion(-) > create mode 100644 t/Biblio/Isbd.t > >diff --git a/C4/Biblio.pm b/C4/Biblio.pm >index 2e8827a..eef2323 100644 >--- a/C4/Biblio.pm >+++ b/C4/Biblio.pm >@@ -923,12 +923,13 @@ Return the ISBD view which can be included in opac and intranet > sub GetISBDView { > my ( $biblionumber, $template ) = @_; > my $record = GetMarcBiblio($biblionumber, 1); >+ my $sysprefname = $template eq 'opac' ? 'opacisbd' : 'isbd'; > return unless defined $record; > my $itemtype = &GetFrameworkCode($biblionumber); > my ( $holdingbrtagf, $holdingbrtagsubf ) = &GetMarcFromKohaField( "items.holdingbranch", $itemtype ); > my $tagslib = &GetMarcStructure( 1, $itemtype ); > >- my $ISBD = C4::Context->preference('isbd'); >+ my $ISBD = C4::Context->preference($sysprefname); > my $bloc = $ISBD; > my $res; > my $blocres; >diff --git a/t/Biblio/Isbd.t b/t/Biblio/Isbd.t >new file mode 100644 >index 0000000..7aeb31b >--- /dev/null >+++ b/t/Biblio/Isbd.t >@@ -0,0 +1,50 @@ >+#!/usr/bin/perl >+ >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it >+# under the terms of the GNU General Public License as published by >+# the Free Software Foundation; either version 3 of the License, or >+# (at your option) any later version. >+# >+# Koha is distributed in the hope that it will be useful, but >+# WITHOUT ANY WARRANTY; without even the implied warranty of >+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >+# GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License >+# along with Koha; if not, see <http://www.gnu.org/licenses>. >+ >+use Modern::Perl; >+ >+use Test::More tests => 3; >+use Test::MockModule; >+use MARC::Record; >+use t::lib::Mocks qw( mock_preference ); >+ >+BEGIN { >+ use_ok('C4::Biblio'); >+} >+ >+my $dbh = C4::Context->dbh; >+# Start transaction >+$dbh->{AutoCommit} = 0; >+$dbh->{RaiseError} = 1; >+ >+my $template = '#200|<h2>Title : |{200a}{ by 200f}|</h2>'; >+my $opac_template = '#200|<h2>Title : |{200a}{ (200f)}|</h2>'; >+t::lib::Mocks::mock_preference('isbd', $template); >+t::lib::Mocks::mock_preference('opacisbd', $opac_template); >+ >+my $record = MARC::Record->new(); >+$record->append_fields( >+ MARC::Field->new('200', '', '', 'a' => 'Montains'), >+ MARC::Field->new('200', '', '', 'f' => 'Keith Lye'), >+); >+my ($bibnum, $title, $bibitemnum) = AddBiblio($record, ''); >+ >+my $isbd = GetISBDView($bibnum); >+is($isbd, '<h2>Title : Montains by Keith Lye</h2>', 'ISBD is correct'); >+ >+my $opacisbd = GetISBDView($bibnum, 'opac'); >+is($opacisbd, '<h2>Title : Montains (Keith Lye)</h2>', 'OPAC ISBD is correct'); >-- >1.7.10.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 5979
:
3480
|
10029
|
10326
|
10327
|
44123
|
44126
|
44208
|
44209
|
44210
|
44211
|
48295
|
49873
|
49874
|
49898
|
49899
|
49900
|
49901
|
49902
|
49903
|
50591