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>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
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';
('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'),
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)
-
- '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:
</li>
[% END %]
- [% IF ( export_options.size ) %]
+ [% SET export_options = Koha.Preference('OpacExportOptions').split(',') %]
+ [% IF export_options.size %]
<li>
<div id="export">
<div class="dropdown">
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 );
$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 );
$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(