From Katrin.Fischer.83 at web.de Sun Jan 1 14:23:07 2012
From: Katrin.Fischer.83 at web.de (Katrin Fischer)
Date: Sun, 1 Jan 2012 14:23:07 +0100
Subject: [Koha-patches] [PATCH] Bug 7392: Add system preference to define
export options in OPAC
Message-ID: <1325424187-15179-1-git-send-email-Katrin.Fischer.83@web.de>
NOTE: Patch depends on changes made for Bug 7245 for the "marcstd" option.
It adds a new system preference 'OpacExportOptions':
The new system preference allows to give a list of | separated
values to define, which download options are offered in OPAC.
Possible options are listed in the system preference editor
and include the new export option 'marcstd' from bug 7245.
The sequence of the download options in the system preference will
be the sequence in the OPAC pull down.
If left empty, the export option will be hidden from OPAC.
This patch creates a new include file for the OPAC with all the
code that is common to the three detail views (regular, MARC, and
ISBD).
As a side effect of creating this include file, some inconsistencies
in OpacSearchForTitleIn were fixed. {BIBLIONUMBER} and {CONTROLNUMBER}
were broken for ISBD and MARC view before and should now be replaced
with the correct values in all tabs.
---
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
diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql
index 128c9b2..6ed5d0f 100755
--- a/installer/data/mysql/sysprefs.sql
+++ b/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');
diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl
index 67708fa..32bc210 100755
--- a/installer/data/mysql/updatedatabase.pl
+++ b/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)
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 d6ae2b2..40cdf78 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
@@ -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
diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc
new file mode 100644
index 0000000..12772aa
--- /dev/null
+++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-detail-sidebar.inc
@@ -0,0 +1,63 @@
+
+ [% UNLESS ( norequests ) %]
+ [% IF ( opacuserlogin ) %]
+ [% IF ( RequestOnOpac ) %]
+ [% IF ( AllowOnShelfHolds ) %]
+ - Place Hold
+ [% ELSE %]
+ [% IF ( ItemsIssued ) %]
+ - Place Hold
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+ - Print
+ [% IF ( virtualshelves ) %]
+ [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %]
+ -
+ Save to Your Lists
+
+ [% END %][% END %]
+ [% END %]
+ [% IF ( opacbookbag ) %]
+ - Add to Your Cart
+ [% END %]
+ - More searches
+
+
+[% IF ( OPACSearchForTitleIn ) %]
+
+[% END %]
+
+[% IF ( export_options.size ) %]
+
+
+
+[% END %]
\ No newline at end of file
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt
index f9984a7..97b64ad 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-ISBDdetail.tt
@@ -46,63 +46,9 @@
-
-[% UNLESS ( norequests ) %]
- [% IF ( opacuserlogin ) %]
- [% IF ( RequestOnOpac ) %]
- [% IF ( AllowOnShelfHolds ) %]
- - Place Hold
- [% ELSE %]
- [% IF ( ItemsIssued ) %]
- - Place Hold
- [% END %]
- [% END %]
+[% INCLUDE 'opac-detail-sidebar.inc' %]
- [% END %]
- [% END %]
-[% END %]
- - Print
-[% IF ( virtualshelves ) %]
- [% IF ( opacuserlogin ) %] [% IF ( loggedinusername ) %]
- -
- Save to Your Lists
-
- [% END %][% END %]
-[% END %]
- [% IF ( opacbookbag ) %]-
- Add to Your Cart
-
[% END %]
- - More searches
-
-
-[% IF ( OPACSearchForTitleIn ) %]
-
-[% END %]
-
-
-
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt
index 284154e..f3d2c91 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-MARCdetail.tt
@@ -201,62 +201,9 @@ $(document).ready(function(){
-
-[% UNLESS ( norequests ) %]
- [% IF ( opacuserlogin ) %]
- [% IF ( RequestOnOpac ) %]
- [% IF ( AllowOnShelfHolds ) %]
- - Place Hold
- [% ELSE %]
- [% IF ( ItemsIssued ) %]
- - Place Hold
- [% END %]
- [% END %]
-
- [% END %]
- [% END %]
-[% END %]
- -
- Print
-
-[% IF ( virtualshelves ) %]
- [% IF ( opacuserlogin ) %] [% IF ( loggedinusername ) %]
- -
- Save to Your Lists
-
- [% END %][% END %]
-[% END %]
- [% IF ( opacbookbag ) %]-
- Add to Your Cart
-
[% END %]
- - More searches
-
-
-[% IF ( OPACSearchForTitleIn ) %]
-
-[% END %]
+[% INCLUDE 'opac-detail-sidebar.inc' %]
-
-
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
index d1b6570..aa411ca 100755
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
@@ -1013,61 +1013,8 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
[% END %]
[% END %]
-
-
-[% UNLESS ( norequests ) %]
- [% IF ( opacuserlogin ) %]
- [% IF ( RequestOnOpac ) %]
- [% IF ( AllowOnShelfHolds ) %]
- - Place Hold
- [% ELSE %]
- [% IF ( ItemsIssued ) %]
- - Place Hold
- [% END %]
- [% END %]
- [% END %]
- [% END %]
-[% END %]
- - Print
-[% IF ( virtualshelves ) %]
- [% IF ( opacuserlogin ) %][% IF ( loggedinusername ) %]
- -
- Save to Your Lists
-
- [% END %][% END %]
-[% END %]
- [% IF ( opacbookbag ) %]- Add to Your Cart
[% END %]
- - More searches
-
-
-[% IF ( OPACSearchForTitleIn ) %]
-
-[% END %]
-
-
-
-
+[% INCLUDE 'opac-detail-sidebar.inc' %]
[% IF ( NovelistSelectProfile ) %] [% IF ( NovelistSelectView == 'right') %]
diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl
index c80d41c..3373787 100755
--- a/opac/opac-ISBDdetail.pl
+++ b/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);
}
diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl
index ffa0a6d..9f552b8 100755
--- a/opac/opac-MARCdetail.pl
+++ b/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);
}
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index f82dde2..59f243e 100755
--- a/opac/opac-detail.pl
+++ b/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);
--
1.7.5.4
From Katrin.Fischer.83 at web.de Sun Jan 1 20:37:06 2012
From: Katrin.Fischer.83 at web.de (Katrin Fischer)
Date: Sun, 1 Jan 2012 20:37:06 +0100
Subject: [Koha-patches] [PATCH] Bug 7345: Follow up: Adding the new export
option to staff interface
Message-ID: <1325446626-19779-1-git-send-email-Katrin.Fischer.83@web.de>
This patch adds the new export option 'marcstd' for exporting MARC
records without 9xx, x9x and xx9 fields and subfields to the staff
detail page.
Patch applies on top of first patch for this bug.
---
catalogue/export.pl | 3 ++-
.../intranet-tmpl/prog/en/includes/cat-toolbar.inc | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/catalogue/export.pl b/catalogue/export.pl
index db69af9..d832fbb 100755
--- a/catalogue/export.pl
+++ b/catalogue/export.pl
@@ -27,6 +27,7 @@ if ($op eq "export") {
if ($biblionumber){
my $marc = GetMarcBiblio($biblionumber, 1);
+ my $error = '';
if ($format =~ /endnote/) {
$marc = marc2endnote($marc);
@@ -53,7 +54,7 @@ if ($op eq "export") {
}
elsif ($format =~ /marcstd/) {
C4::Charset::SetUTF8Flag($marc,1);
- ($error,$marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour'));
+ ($error, $marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour'));
}
print $query->header(
-type => 'application/octet-stream',
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 413d7f4..114f345 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
@@ -122,7 +122,8 @@ function confirm_items_deletion() {
{ text: _("Dublin Core (XML)"), url: "/cgi-bin/koha/catalogue/export.pl?format=dc&op=export&bib=[% biblionumber %]" },
{ text: _("MARCXML"), url: "/cgi-bin/koha/catalogue/export.pl?format=marcxml&op=export&bib=[% biblionumber %]" },
{ text: _("MARC (non-Unicode/MARC-8)"), url: "/cgi-bin/koha/catalogue/export.pl?format=marc8&op=export&bib=[% biblionumber %]" },
- { text: _("MARC (Unicode/UTF-8)"), url: "/cgi-bin/koha/catalogue/export.pl?format=utf8&op=export&bib=[% biblionumber %]" }
+ { text: _("MARC (Unicode/UTF-8)"), url: "/cgi-bin/koha/catalogue/export.pl?format=utf8&op=export&bib=[% biblionumber %]" },
+ { text: _("MARC (Unicode/UTF-8, Standard)"), url: "/cgi-bin/koha/catalogue/export.pl?format=marcstd&op=export&bib=[% biblionumber %]" }
];
new YAHOO.widget.Button({
--
1.7.5.4
From jonathan.druart at biblibre.com Mon Jan 2 09:46:28 2012
From: jonathan.druart at biblibre.com (Jonathan Druart)
Date: Mon, 2 Jan 2012 09:46:28 +0100
Subject: [Koha-patches] [PATCH 1/1] [SIGNED-OFF] Bug 5347: Follow up - Fix
warnings, check/uncheck all and makes error message translatable
Message-ID: <1325493988-6861-1-git-send-email-jonathan.druart@biblibre.com>
From: Katrin Fischer
This patch fixes some minor problems found in late order management:
1) Silences 2 warns in Letters.p
After patch is applied no more warns should show up in the logs.
2) Fixes check/uncheck al
When limiting on one vendor the checkbox in the last header column
was doing nothing. I changed the checkbox to 2 links 'check all' and
'uncheck all' as it's done in other templates.
3) Email has been sent
The message was hardcoded into the lateorders.pl file and not
translatable.
I moved it to the template and changed the wording slightly.
Note: The error message 'The bookseller has no email' comes from
Letters.pm. I didn't change that, because I was not sure where it is
used. The error message as is can not be translated and should be
moved into the templates too.
---
C4/Letters.pm | 4 ++--
acqui/lateorders.pl | 2 +-
.../prog/en/modules/acqui/lateorders.tt | 11 +++++++----
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/C4/Letters.pm b/C4/Letters.pm
index 5cde41d..5e3089b 100644
--- a/C4/Letters.pm
+++ b/C4/Letters.pm
@@ -393,7 +393,7 @@ sub SendAlerts {
'Content-Type' => 'text/plain; charset="utf8"',
);
sendmail(%mail) or carp $Mail::Sendmail::error;
- warn "sending to $mail{To} From $mail{From} subj $mail{Subject} Mess $mail{Message}";
+ warn "sending to $mail{To} From $mail{From} subj $mail{Subject} Mess $mail{Message}" if $debug;
if ( C4::Context->preference("LetterLog") ) {
logaction( "ACQUISITION", "Send Acquisition claim letter", "", "order list : " . join( ",", @$externalid ) . "\n$innerletter->{title}\n$innerletter->{content}" ) if $type eq 'claimacquisition';
logaction( "ACQUISITION", "CLAIM ISSUE", undef, "To=" . $mail{To} . " Title=" . $innerletter->{title} . " Content=" . $innerletter->{content} ) if $type eq 'claimissues';
@@ -402,7 +402,7 @@ sub SendAlerts {
die "This bookseller has no email\n";
}
- warn "sending to From $userenv->{emailaddress} subj $innerletter->{title} Mess $innerletter->{content}";
+ warn "sending to From $userenv->{emailaddress} subj $innerletter->{title} Mess $innerletter->{content}" if $debug;
}
# send an "account details" notice to a newly created user
diff --git a/acqui/lateorders.pl b/acqui/lateorders.pl
index 2482ffb..998899e 100755
--- a/acqui/lateorders.pl
+++ b/acqui/lateorders.pl
@@ -85,7 +85,7 @@ if ($op and $op eq "send_alert"){
if ( $@ ) {
$template->param(error_claim => $@);
} else {
- $template->param(info_claim => "Emails have been sent");
+ $template->{VARS}->{'info_claim'} = 1;
}
}
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
index 8227722..5ce1fae 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/lateorders.tt
@@ -1,6 +1,7 @@
[% INCLUDE 'doc-head-open.inc' %]
Koha › Acquisitions › Late orders
[% INCLUDE 'doc-head-close.inc' %]
+
@@ -35,7 +38,7 @@ $(document).ready(function() {
[% error_claim %]
[% END %]
[% IF info_claim %]
- [% info_claim %]
+ Email has been sent.
[% END %]
[% IF ( lateorders ) %]