Bugzilla – Attachment 34748 Details for
Bug 13346
The type of the OpacExportOptions pref should be multiple
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13346: OpacExportOptions becomes multiple
Bug-13346-OpacExportOptions-becomes-multiple.patch (text/plain), 8.04 KB, created by
Chris Cormack
on 2014-12-28 06:38:20 UTC
(
hide
)
Description:
Bug 13346: OpacExportOptions becomes multiple
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2014-12-28 06:38:20 UTC
Size:
8.04 KB
patch
obsolete
>From 678b21fd317a5a12aca7bcf6289976fce031c2a7 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Wed, 26 Nov 2014 12:58:41 +0100 >Subject: [PATCH] Bug 13346: OpacExportOptions becomes multiple > >The list of options is limited, the interface could be more ergonomic. > >Test plan: >- verify that you are still allowed to change (add/remove) options for the > OpacExportOptions pref. >- At the OPAC, verify the selected options appear correctly (check the > 3 pages opac-ISBDdetail.pl, opac-MARCdetail.pl and opac-detail.pl). > >Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> >--- > .../1-Obligatoire/unimarc_standard_system_preferences.sql | 2 +- > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 14 ++++++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 13 +++++++++---- > .../bootstrap/en/includes/opac-detail-sidebar.inc | 3 ++- > opac/opac-ISBDdetail.pl | 5 ----- > opac/opac-MARCdetail.pl | 5 ----- > opac/opac-detail.pl | 5 ----- > 8 files changed, 27 insertions(+), 22 deletions(-) > >diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql >index 065c6b3..94ee493 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql >+++ b/installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_system_preferences.sql >@@ -24,4 +24,4 @@ UPDATE systempreferences SET value = 'Ma bibliothèque' WHERE variable = 'Librar > UPDATE systempreferences SET value = 'fr-FR' WHERE variable = 'opaclanguages'; > UPDATE systempreferences SET value = 1 WHERE variable = 'opaclanguagesdisplay'; > UPDATE systempreferences SET value = 'Bienvenue dans Koha...\r\n<hr>' WHERE variable = 'OpacMainUserBlock'; >-UPDATE systempreferences SET value = 'bibtex|dc|marcxml|marc8|utf8|marcstd|ris' WHERE variable = 'OpacExportOptions'; >+UPDATE systempreferences SET value = 'bibtex,dc,marcxml,marc8,utf8,marcstd,ris' WHERE variable = 'OpacExportOptions'; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index db9fd84..89707ef 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -252,7 +252,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('OPACdefaultSortOrder','dsc','asc|dsc|za|az','Specify the default sort order','Choice'), > ('OPACdidyoumean',NULL,NULL,'Did you mean? configuration for the OPAC. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'), > ('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','','Define export options available on OPAC detail page.','free'), >+('OpacExportOptions','bibtex,dc,marcxml,marc8,utf8,marcstd,mods,ris','','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/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index b06142c..d0c5ee8 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9608,6 +9608,20 @@ if ( CheckVersion($DBversion) ) { > SetVersion ($DBversion); > } > >+$DBversion = "3.19.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ my $pref_value = C4::Context->preference('OpacExportOptions'); >+ $pref_value =~ s/\|/,/g; # multiple is separated by , >+ $dbh->do(q{ >+ UPDATE systempreferences >+ SET value = ?, >+ type = 'multiple' >+ WHERE variable = 'OpacExportOptions' >+ }, {}, $pref_value ); >+ print "Upgrade to $DBversion done (Bug XXXXX: OpacExportOptions is now multiple)\n"; >+ SetVersion ($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >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 45df9f8..f0c0951 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 >@@ -275,10 +275,15 @@ OPAC: > - > - 'List export options that should be available from OPAC detail page separated by |:' > - pref: OpacExportOptions >- class: multi >- - '<br />Note: Available options are: BIBTEX (<code>bibtex</code>), Dublin Core (<code>dc</code>),' >- - 'MARCXML (<code>marcxml</code>), MARC-8 encoded MARC (<code>marc8</code>), Unicode/UTF-8 encoded MARC (<code>utf8</code>),' >- - 'Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields (<code>marcstd</code>), MODS (<code>mods</code>), RIS (<code>ris</code>)' >+ multiple: >+ bibtex: BibTeX >+ dc: Dublin Core >+ marcxml: MARCXML >+ marc8: MARC-8 encoded MARC >+ utf8: Unicode/UTF-8 encoded MARC >+ marcstd: Unicode/UTF-8 encoded MARC without local use -9xx, x9x, xx9- fields and subfields >+ mods: MODS >+ ris: RIS > - > - 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 b15333b..3efa10c 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 >@@ -34,7 +34,8 @@ > </li> > [% END %] > >- [% IF ( export_options.size ) %] >+ [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %] >+ [% IF export_options.size %] > <li> > <div id="export"> > <div class="dropdown"> >diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl >index c3c03c1..2acddb4 100755 >--- a/opac/opac-ISBDdetail.pl >+++ b/opac/opac-ISBDdetail.pl >@@ -180,11 +180,6 @@ $template->param( > reviews => $reviews, > ); > >-#Export options >-my $OpacExportOptions=C4::Context->preference("OpacExportOptions"); >-my @export_options = split(/\|/,$OpacExportOptions); >-$template->{VARS}->{'export_options'} = \@export_options; >- > #Search for title in links > my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); > my $marcissns = GetMarcISSN ( $record, $marcflavour ); >diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl >index f8fab90..2e9b537 100755 >--- a/opac/opac-MARCdetail.pl >+++ b/opac/opac-MARCdetail.pl >@@ -314,11 +314,6 @@ if(C4::Context->preference("ISBD")) { > $template->param(ISBD => 1); > } > >-#Export options >-my $OpacExportOptions=C4::Context->preference("OpacExportOptions"); >-my @export_options = split(/\|/,$OpacExportOptions); >-$template->{VARS}->{'export_options'} = \@export_options; >- > #Search for title in links > my $marcflavour = C4::Context->preference("marcflavour"); > my $dat = TransformMarcToKoha( $dbh, $record ); >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 3bf703f..9ba8120 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -1058,11 +1058,6 @@ if (C4::Context->preference("OPACURLOpenInNewWindow")) { > $template->param(covernewwindow => 'false'); > } > >-#Export options >-my $OpacExportOptions=C4::Context->preference("OpacExportOptions"); >-my @export_options = split(/\|/,$OpacExportOptions); >-$template->{VARS}->{'export_options'} = \@export_options; >- > if ( C4::Context->preference('OpacStarRatings') !~ /disable/ ) { > my $rating = GetRating( $biblionumber, $borrowernumber ); > $template->param( >-- >2.1.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 13346
:
33955
|
34748
|
34895