Bugzilla – Attachment 97105 Details for
Bug 17385
Add custom export formats for bibliographic records
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17385: QA Critics Fixed and added Missing Filters
Bug-17385-QA-Critics-Fixed-and-added-Missing-Filte.patch (text/plain), 11.19 KB, created by
Gabriel DeCarufel
on 2020-01-09 15:38:00 UTC
(
hide
)
Description:
Bug 17385: QA Critics Fixed and added Missing Filters
Filename:
MIME Type:
Creator:
Gabriel DeCarufel
Created:
2020-01-09 15:38:00 UTC
Size:
11.19 KB
patch
obsolete
>From 58482aa97872d36b20db13327fa70daef889a393 Mon Sep 17 00:00:00 2001 >From: Gabriel DeCarufel <gabriel@inlibro.com> >Date: Wed, 8 Jan 2020 16:23:14 -0500 >Subject: [PATCH] Bug 17385: QA Critics Fixed and added Missing Filters > >--- > C4/XSLT.pm | 13 ++++++++++--- > .../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 2 +- > .../prog/en/includes/virtualshelves-toolbar.inc | 2 +- > .../intranet-tmpl/prog/en/modules/basket/basket.tt | 2 +- > .../prog/en/modules/catalogue/detail.tt | 2 +- > .../prog/en/modules/virtualshelves/downloadshelf.tt | 2 +- > .../bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- > .../bootstrap/en/modules/opac-downloadcart.tt | 2 +- > .../bootstrap/en/modules/opac-downloadshelf.tt | 2 +- > t/db_dependent/XSLT.t | 4 ++-- > 10 files changed, 20 insertions(+), 13 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 798c66e6ee..7643bec969 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -164,6 +164,12 @@ sub _get_best_default_xslt_filename { > return $xslfilename; > } > >+=head2 get_xslt_sysprefs >+ >+ returns XML xslt sysprefs. >+ >+=cut >+ > sub get_xslt_sysprefs { > my $sysxml = "<sysprefs>\n"; > foreach my $syspref ( qw/ hidelostitems OPACURLOpenInNewWindow >@@ -263,7 +269,7 @@ sub XSLTParse4Display { > my $itemsxml = buildKohaItemsNamespace($biblionumber, $hidden_items); > my $xmlrecord = $record->as_xml(C4::Context->preference('marcflavour')); > >- $variables ||= {}; >+ my $variables ||= {}; > if (C4::Context->preference('OPACShowOpenURL')) { > my @biblio_itemtypes; > my $biblio = Koha::Biblios->find($biblionumber); >@@ -416,7 +422,7 @@ sub CustomXSLTExportList { > '/' . C4::Context->preference( $opac ? "opacthemes" : "template") . > '/' . C4::Languages::getlanguage() . > '/xslt/biblioexport'; >- my @files = <$dir/*.xsl>; >+ my @files = glob qq("$dir/*.xsl"); > foreach my $file (@files) { > if ( -f "$file" ) { > (my $text = $file) =~ s/.*\///g; >@@ -433,7 +439,8 @@ sub CustomXSLTExportList { > # Get output format > # There should only be one xsl:output node, so taking the first one only is OK > $node = @{$node->findnodes("xsl:output")}[0]; >- my $outputformat = $node->{"method"} if $node; >+ my $outputformat= ""; >+ $outputformat = $node->{"method"} if $node; > $outputformat = "txt" if ($outputformat eq "" || $outputformat eq "text"); > > my %row = ( >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >index 39bd7c95e5..ce0a0da854 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc >@@ -97,7 +97,7 @@ CAN_user_serials_create_subscription ) %] > <li><a href="/cgi-bin/koha/catalogue/export.pl?format=mods&op=export&bib=[% biblionumber | uri %]">MODS (XML)</a></li> > <li><a href="/cgi-bin/koha/catalogue/export.pl?format=ris&op=export&bib=[% biblionumber | uri %]">RIS</a></li> > [% FOREACH filesOption IN filesOptions %] >- <li><a href="/cgi-bin/koha/catalogue/export.pl?format=[% filesOption.format %]&op=exportxsl&file=[% filesOption.value %]&bib=[% biblionumber | html %]">[% filesOption.filename %]</a></li> >+ <li><a href="/cgi-bin/koha/catalogue/export.pl?format=[% filesOption.format | uri %]&op=exportxsl&file=[% filesOption.value | uri %]&bib=[% biblionumber | uri %]">[% filesOption.filename | html %]</a></li> > [% END %] > </ul> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >index 6c5bd3db77..c241f343f3 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/virtualshelves-toolbar.inc >@@ -32,7 +32,7 @@ > <li><a href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=[% csv_profile.export_format_id | uri %]&shelfid=[% shelf.shelfnumber | uri %]">CSV - [% csv_profile.profile | html %]</a></li> > [% END %] > [% FOREACH xsl_export IN xsl_exports %] >- <li><a href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=xsl.[% xsl_export.value %]&shelfid=[% shelf.shelfnumber %]">XSL - [% xsl_export.filename %]</a></li> >+ <li><a href="/cgi-bin/koha/virtualshelves/downloadshelf.pl?format=xsl.[% xsl_export.value | uri %]&shelfid=[% shelf.shelfnumber | uri %]">XSL - [% xsl_export.filename | html %]</a></li> > [% END %] > </ul> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >index 9c388ba1bc..ce428c396e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt >@@ -57,7 +57,7 @@ > <li><a href="/cgi-bin/koha/basket/downloadcart.pl?format=[% csv_profile.export_format_id | uri %]&bib_list=[% bib_list | uri %]">CSV - [% csv_profile.profile | html %]</a></li> > [% END %] > [% FOREACH xsl_export IN xsl_exports %] >- <li><a href="/cgi-bin/koha/basket/downloadcart.pl?format=xsl.[% xsl_export.value %]&bib_list=[% bib_list %]">XSL - [% xsl_export.filename %]</a></li> >+ <li><a href="/cgi-bin/koha/basket/downloadcart.pl?format=xsl.[% xsl_export.value | uri %]&bib_list=[% bib_list | uri %]">XSL - [% xsl_export.filename | html %]</a></li> > [% END %] > </ul> > </div> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 7c2387f818..6ead8bf3e8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -753,7 +753,7 @@ > <option value="marc8">MARC (non-Unicode/MARC-8)</option> > <option value="utf8">MARC (Unicode/UTF-8)</option> > [% FOREACH filesOption IN filesOptions %] >- <option value="[% filesOption.value %]">[% filesOption.filename %]</option> >+ <option value="[% filesOption.value | html %]">[% filesOption.filename | html %]</option> > [% END %]</select> > <input type="submit" name="save" value="Download Record" /></td> > </tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt >index 740fe5d1f0..772ac50ab8 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/downloadshelf.tt >@@ -37,7 +37,7 @@ > <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option> > [% END %] > [% FOREACH xsl_export IN xsl_exports %] >- <option value="xsl.[% xsl_export.value %]">XSL - [% xsl_export.filename %]</option> >+ <option value="xsl.[% xsl_export.value | html %]">XSL - [% xsl_export.filename | html %]</option> > [% END %] > </select> > </li></ol> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >index 4e1ae642c1..7d07e07ed8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc >@@ -80,7 +80,7 @@ > </li> > [% ELSE %] > [% FOREACH filesOption IN filesOptions %] >- <li><a role="menuitem" href="/cgi-bin/koha/opac-export.pl?format=[% filesOption.format %]&op=exportxsl&file=[% filesOption.value %]&bib=[% biblionumber %]">[% filesOption.filename %]</a></li> >+ <li><a role="menuitem" href="/cgi-bin/koha/opac-export.pl?format=[% filesOption.format | html %]&op=exportxsl&file=[% filesOption.value | html %]&bib=[% biblionumber | html %]">[% filesOption.filename | html %]</a></li> > [% END %] > [% END %] > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt >index 70c3beb1a3..2bd1215ebc 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadcart.tt >@@ -21,7 +21,7 @@ > <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option> > [% END %] > [% FOREACH xsl_export IN xsl_exports %] >- <option value="xsl.[% xsl_export.value %]">XSL - [% xsl_export.filename %]</option> >+ <option value="xsl.[% xsl_export.value | html %]">XSL - [% xsl_export.filename | html %]</option> > [% END %] > </select> > <fieldset class="action"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt >index 4881ea7aa9..411168ea29 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-downloadshelf.tt >@@ -60,7 +60,7 @@ > <option value="[% csv_profile.export_format_id | html %]">CSV - [% csv_profile.profile | html %]</option> > [% END %] > [% FOREACH xsl_export IN xsl_exports %] >- <option value="xsl.[% xsl_export.value %]">XSL - [% xsl_export.filename %]</option> >+ <option value="xsl.[% xsl_export.value | html %]">XSL - [% xsl_export.filename | html %]</option> > [% END %] > </select> > <span class="required">Required</span> >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index 968f7db8ad..74899b1391 100644 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -1,5 +1,5 @@ > use Modern::Perl; >-use Test::More tests => 2; >+use Test::More tests => 1; > > use t::lib::Mocks; > use C4::XSLT; >@@ -35,4 +35,4 @@ subtest 'CustomXSLTExportList: Caching' => sub { > is( @$list, $n, 'This list comes from the cache and that is fine' ); > $cache->clear_from_cache('CustomXSLTExportListOPAC'); > }; >-$schema->storage->txn_rollback; >+$schema->storage->txn_rollback; >\ No newline at end of file >-- >2.17.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 17385
:
55961
|
58308
|
64033
|
64034
|
67357
|
67579
|
74660
|
74661
|
79055
|
79056
|
80675
|
81385
|
81386
|
84388
|
84389
|
84390
|
86875
|
86876
|
86877
|
86878
|
86879
|
86880
|
97076
|
97101
|
97102
|
97103
|
97104
|
97105
|
100289
|
100290
|
100291
|
100292
|
100293
|
100663
|
100670
|
100671
|
100672
|
100673
|
100674
|
100675
|
112671
|
112672
|
112673
|
112674
|
112675
|
112676
|
112677
|
112678
|
112679
|
112680
|
112681
|
112682
|
112956
|
112957
|
112958
|
112959
|
130283
|
130284
|
130285
|
130286
|
130287
|
130691
|
130692
|
130693
|
130694
|
130695
|
131492
|
132488
|
132489
|
132490
|
132491
|
132492
|
132493
|
132581
|
133498
|
133499
|
133500
|
133501
|
133502
|
133503
|
133504
|
138031
|
138032
|
138033
|
138034
|
138035
|
138036
|
138037
|
138082
|
138083
|
138084
|
138085
|
138086
|
138087
|
138088
|
138132
|
139277
|
139278
|
139279
|
139280
|
139281
|
139282
|
139283
|
139284
|
141157
|
141158
|
141159
|
141160
|
141161
|
141162
|
141163
|
141164
|
144335
|
144336
|
144380
|
144384
|
151095
|
151096
|
151097
|
151098
|
151099
|
151102
|
151103
|
151104
|
151105
|
151106
|
151377
|
151378
|
151379
|
151380
|
151381
|
154379
|
154380
|
154381
|
154382
|
154383
|
156815
|
156816
|
156817
|
156818
|
156819
|
159142
|
159143
|
159144
|
159145
|
159146
|
159147
|
159148
|
163623
|
170014
|
170015
|
170016
|
170017
|
170018
|
170019
|
170026
|
170027
|
170028
|
170029
|
170030
|
170031
|
170983
|
170984
|
170985
|
170986
|
170987
|
170988