Bugzilla – Attachment 181452 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: Replace "custom" keyword by "html" for consistency
Bug-17385-Replace-custom-keyword-by-html-for-consi.patch (text/plain), 8.96 KB, created by
Shi Yao Wang
on 2025-04-24 13:26:44 UTC
(
hide
)
Description:
Bug 17385: Replace "custom" keyword by "html" for consistency
Filename:
MIME Type:
Creator:
Shi Yao Wang
Created:
2025-04-24 13:26:44 UTC
Size:
8.96 KB
patch
obsolete
>From d4a2afc2af92c133b44d54dff6a54e9f96ce9b02 Mon Sep 17 00:00:00 2001 >From: Shi Yao Wang <shi-yao.wang@inlibro.com> >Date: Thu, 3 Apr 2025 12:08:39 -0400 >Subject: [PATCH] Bug 17385: Replace "custom" keyword by "html" for consistency > >Same test plan as before >--- > C4/XSLT.pm | 2 +- > .../bug_17385-CustomOptionForOpacExportOptions_syspref.pl | 4 ++-- > installer/data/mysql/mandatory/sysprefs.sql | 2 +- > .../intranet-tmpl/prog/en/modules/admin/preferences/opac.pref | 2 +- > .../opac-tmpl/bootstrap/en/includes/opac-detail-sidebar.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 2 +- > t/db_dependent/XSLT.t | 4 ++-- > 8 files changed, 10 insertions(+), 10 deletions(-) > >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index 22963ab065..43e15bacee 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -444,7 +444,7 @@ sub engine { > > sub CustomXSLTExportList { > my $opac = shift; # opac (1) vs intranet (0) >- return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /custom/; >+ return [] if $opac && C4::Context->preference('OpacExportOptions') !~ /html/; > > my $customXSLTExportPath = C4::Context->preference('CustomXSLTExportPath'); > # Check the cache first >diff --git a/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl b/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl >index e804c7ee70..6c8e04e082 100644 >--- a/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl >+++ b/installer/data/mysql/atomicupdate/bug_17385-CustomOptionForOpacExportOptions_syspref.pl >@@ -2,7 +2,7 @@ use Modern::Perl; > > return { > bug_number => "17385", >- description => "Add a custom option for OpacExportOptions system preference", >+ description => "Add a custom html option for OpacExportOptions system preference", > up => sub { > my ($args) = @_; > my ( $dbh, $out ) = @$args{qw(dbh out)}; >@@ -10,7 +10,7 @@ return { > $dbh->do( > q{ > UPDATE systempreferences >- SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,custom' >+ SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,html' > WHERE variable = 'OpacExportOptions'; > } > ); >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index a8f44f4c3a..f19b081d8f 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -493,7 +493,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACdidyoumean','',NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), > ('OPACDisableSendList','0',NULL,'Allow OPAC users to email lists via a "Send list" button','YesNo'), > ('OPACDisplay856uAsImage','OFF','OFF|Details|Results|Both','Display the URI in the 856u field as an image, the corresponding OPACXSLT option must be on','Choice'), >-('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,custom','','Define export options available on OPAC detail page.','multiple'), >+('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris,isbd,html','','Define export options available on OPAC detail page.','multiple'), > ('OPACFallback', 'prog', 'bootstrap|prog', 'Define the fallback theme for the OPAC interface.', 'Themes'), > ('OpacFavicon','','','Enter a complete URL to an image to replace the default Koha favicon on the OPAC','free'), > ('OPACFineNoRenewals','100','','Fine limit above which user cannot renew books via OPAC','Integer'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index bf03c8cffa..4ec9a8623b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >@@ -306,7 +306,7 @@ OPAC: > mods: MODS > ris: RIS > isbd: ISBD >- custom: Simple HTML formats >+ html: Simple HTML formats > - > - pref: OpacSeparateHoldings > choices: >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 70da57f77a..aaa52b2c5b 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 >@@ -98,7 +98,7 @@ > [% FOREACH option IN export_options %] > [% IF option == 'dc' %] > <a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#exportModal_">Dublin Core</a> >- [% ELSIF option != 'custom' %] >+ [% ELSIF option != 'html' %] > <a class="dropdown-item" href="/cgi-bin/koha/opac-export.pl?op=export&bib=[% biblio.biblionumber | html %]&format=[% option | html %]"> > [% SWITCH option %] > [% CASE 'bibtex' %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >index c375aa4375..0f156ec9f3 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-basket.tt >@@ -63,7 +63,7 @@ > <a role="menuitem" class="dropdown-item download-cart" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a> > [% END %] > [% FOREACH option IN export_options %] >- [% IF option == 'custom' %] >+ [% IF option == 'html' %] > [% FOREACH xsl_export IN xsl_exports %] > <a role="menuitem" class="dropdown-item" href="/cgi-bin/koha/opac-downloadcart.pl?format=xsl.[% xsl_export.value | uri %]&file=[% xsl_export.value | uri %]&bib_list=[% bib_list | uri %]">[% xsl_export.filename | html %]</a> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index 0ef5fa8ab5..34db844627 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -257,7 +257,7 @@ > <a role="menuitem" class="dropdown-item download-list" data-format="[% csv_profile.export_format_id | html %]" href="#">CSV - [% csv_profile.profile | html %]</a> > [% END %] > [% FOREACH option IN export_options %] >- [% IF option == 'custom' %] >+ [% IF option == 'html' %] > [% FOREACH xsl_export IN xsl_exports %] > <a role="menuitem" class="dropdown-item" href="/cgi-bin/koha/opac-downloadshelf.pl?format=xsl.[% xsl_export.value | uri %]&file=[% xsl_export.value | uri %]&shelfnumber=[% shelf.shelfnumber | uri %]">[% xsl_export.filename | html %]</a> > [% END %] >diff --git a/t/db_dependent/XSLT.t b/t/db_dependent/XSLT.t >index ff7850da6c..97f1f7fd26 100755 >--- a/t/db_dependent/XSLT.t >+++ b/t/db_dependent/XSLT.t >@@ -118,7 +118,7 @@ subtest 'Tests moved from t' => sub { > make_path( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" ); > createXSLTFiles( "$dir/bootstrap/" . C4::Languages::getlanguage() . "/xslt/biblioexport" ); > >- t::lib::Mocks::mock_preference( 'OpacExportOptions', 'custom' ); >+ t::lib::Mocks::mock_preference( 'OpacExportOptions', 'html' ); > my @custom_xslts = @{ C4::XSLT::CustomXSLTExportList(1) }; > > ok( ( scalar @custom_xslts) == 2, "CustomXSLTExportList finds custom XSLTs" ); >@@ -280,7 +280,7 @@ subtest 'buildKohaItemsNamespace status tests' => sub { > > subtest 'CustomXSLTExportList: Check export options' => sub { > plan tests => 2; >- t::lib::Mocks::mock_preference('OpacExportOptions', 'custom'); >+ t::lib::Mocks::mock_preference('OpacExportOptions', 'html'); > my $list = C4::XSLT::CustomXSLTExportList(1); > is( $list>0, 1, 'We expect at least one result: simple export' ); > $cache->clear_from_cache('CustomXSLTExportListOPAC'); >-- >2.43.0
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
|
179861
|
179862
|
179863
|
179864
|
179865
|
179866
|
180225
|
180400
|
180599
|
181445
|
181446
|
181447
|
181448
|
181449
|
181450
|
181451
| 181452