@@ -, +, @@ OPAC --- installer/data/mysql/sysprefs.sql | 2 +- installer/data/mysql/updatedatabase.pl | 9 +++ .../prog/en/modules/admin/preferences/opac.pref | 9 +++- .../prog/en/includes/opac-detail-sidebar.inc | 63 ++++++++++++++++++++ .../opac-tmpl/prog/en/modules/opac-ISBDdetail.tt | 56 +----------------- .../opac-tmpl/prog/en/modules/opac-MARCdetail.tt | 55 +----------------- koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 55 +----------------- opac/opac-ISBDdetail.pl | 9 +++ opac/opac-MARCdetail.pl | 22 +++++-- opac/opac-detail.pl | 5 ++ 10 files changed, 115 insertions(+), 170 deletions(-) create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -328,4 +328,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); - +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacExportOptions','bibtex|dc|marcxml|marc8|utf8|marcstd|mods|ris','Define export options available on OPAC detail page.','','free'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -4585,6 +4585,15 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.06.03.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacExportOptions','bibtex|dc|marcxml|marc8|utf8|marcstd|mods|ris','Define available export options on OPAC detail page.','','free');"); + print "Upgrade to $DBversion done (Bug 7345: Add system preference OpacExportOptions.)\n"; + SetVersion($DBversion); +} + + + =head1 FUNCTIONS =head2 DropAllForeignKeys($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -132,7 +132,7 @@ OPAC: class: file - to override specified settings from the default stylesheet. Enter the filename (if the file is in the server's css directory) or a complete URL beginning with http:// (if the file lives on a remote server). Leave blank to disable. - - - Use the CSS stylesheet /css/ + - Use the CSS stylesheet [% opacthemelang %]/css/ - pref: opaclayoutstylesheet class: file - on all pages in the OPAC, instead of the default (leave blank to disable). @@ -208,6 +208,13 @@ OPAC: Results: "Results page only" Both: "Both Details and Results pages" - 'Note: The corresponding OPACXSLT option must be turned on.' + - + - 'List export options that should be available from OPAC detail page separated by |:' + - pref: OpacExportOptions + class: multi + - '
Note: Available options are: BIBTEX (bibtex), Dublin Core (dc),' + - 'MARCXML (marcxml), MARC-8 encoded MARC (marc8), Unicode/UTF-8 encoded MARC (utf8),' + - 'Unicode/UTF-8 encoded MARC without local use (9xx, x9x, xx9) fields and subfields (marcstd), MODS (mods), RIS (ris)' Features: - - pref: opacuserlogin --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc +++ a/koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc @@ -0,0 +1,63 @@ + + +[% IF ( OPACSearchForTitleIn ) %] +
+
+

Search for this title in:

+ +
+
+[% END %] + +[% IF ( export_options.size ) %] +
+
+ + + + +
+
+[% END %] --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt @@ -46,63 +46,9 @@
- - -[% IF ( OPACSearchForTitleIn ) %] -
-
-

Search for this title in:

-
    - -[% OPACSearchForTitleIn %] - -
-
-
-[% END %] - -
-
- - -
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt @@ -201,62 +201,9 @@ $(document).ready(function(){
- - -[% IF ( OPACSearchForTitleIn ) %] -
-
-

Search for this title in:

-
    - -[% OPACSearchForTitleIn %] - -
-
-
-[% END %] +[% INCLUDE 'opac-detail-sidebar.inc' %] -
-
- - -
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt @@ -1013,61 +1013,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () { [% END %] [% END %] - - -[% IF ( OPACSearchForTitleIn ) %] -
-
-

Search for this title in:

- -
-
-[% END %] - -
-
- - -
-
+[% INCLUDE 'opac-detail-sidebar.inc' %] [% IF ( NovelistSelectProfile ) %] [% IF ( NovelistSelectView == 'right') %]
--- a/opac/opac-ISBDdetail.pl +++ a/opac/opac-ISBDdetail.pl @@ -159,13 +159,22 @@ $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); + if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g; $dat->{title} =~ s/\/+$//; # remove trailing slash $dat->{title} =~ s/\s+$//; # remove trailing space $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g; $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g; + $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g; + $search_for_title =~ s/{BIBLIONUMBER}/$biblionumber/g; $template->param('OPACSearchForTitleIn' => $search_for_title); } --- a/opac/opac-MARCdetail.pl +++ a/opac/opac-MARCdetail.pl @@ -270,13 +270,25 @@ 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 ); +my $isbn = GetNormalizedISBN(undef,$record,$marcflavour); +my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); + if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ - $biblio->{author} ? $search_for_title =~ s/{AUTHOR}/$biblio->{author}/g : $search_for_title =~ s/{AUTHOR}//g; - $biblio->{title} =~ s/\/+$//; # remove trailing slash - $biblio->{title} =~ s/\s+$//; # remove trailing space - $biblio->{title} ? $search_for_title =~ s/{TITLE}/$biblio->{title}/g : $search_for_title =~ s/{TITLE}//g; - $biblio->{isbn} ? $search_for_title =~ s/{ISBN}/$biblio->{isbn}/g : $search_for_title =~ s/{ISBN}//g; + $dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g; + $dat->{title} =~ s/\/+$//; # remove trailing slash + $dat->{title} =~ s/\s+$//; # remove trailing space + $dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g; + $isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g; + $marccontrolnumber ? $search_for_title =~ s/{CONTROLNUMBER}/$marccontrolnumber/g : $search_for_title =~ s/{CONTROLNUMBER}//g; + $search_for_title =~ s/{BIBLIONUMBER}/$biblionumber/g; $template->param('OPACSearchForTitleIn' => $search_for_title); } --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -881,6 +881,11 @@ 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; + #Search for title in links my $marccontrolnumber = GetMarcControlnumber ($record, $marcflavour); --