From 7cbbbb04df3b7c13af551992ad77b1af773602e2 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Mon, 20 Oct 2014 12:36:36 +0200 Subject: [PATCH] Bug 13203: Plugin housekeeping: UNIMARC field 123i, 123j, 210c In working on bug 10480, I noticed that these plugins needed some attention: [2] unimarc_field_123i.pl: added missing template [3] unimarc_field_123j.pl: resolved missing template with same file [4] unimarc_field_210c_bis.pl: removed a warn, corrected some POD lines Note about UNIMARC field 123i and 123j: Subfields $i and $j are each 8 characters long and contain the same components as subfields $f and $g except that character position 0 contains a plus sign (for the northern celestial hemisphere) or a minus sign (for the southern celestial hemisphere). Test plan: Connect unimarc_field_123i and 123j to some field. Look especially at changing + or - for the hemisphere in the popup. Check left-padding with zeroes for the other positions. Signed-off-by: Jonathan Druart Signed-off-by: Katrin Fischer Passes tests and QA script. Checked plugin in a UNIMARC installation. Signed-off-by: Tomas Cohen Arazi --- .../value_builder/unimarc_field_123i.pl | 4 +- .../value_builder/unimarc_field_123j.pl | 4 +- .../value_builder/unimarc_field_210c_bis.pl | 7 +-- .../value_builder/unimarc_field_123i_j.tt | 57 +++++++++++++++++++ 4 files changed, 64 insertions(+), 8 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt diff --git a/cataloguing/value_builder/unimarc_field_123i.pl b/cataloguing/value_builder/unimarc_field_123i.pl index 8b39e73db7..5ada49fb86 100755 --- a/cataloguing/value_builder/unimarc_field_123i.pl +++ b/cataloguing/value_builder/unimarc_field_123i.pl @@ -72,7 +72,7 @@ my ($input) = @_; my $dbh = C4::Context->dbh; my ($template, $loggedinuser, $cookie) - = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123i.tt", + = get_template_and_user({template_name => "cataloguing/value_builder/unimarc_field_123i_j.tt", query => $input, type => "intranet", authnotrequired => 0, @@ -84,7 +84,7 @@ my ($template, $loggedinuser, $cookie) my $f3 = substr($result,4,2); my $f4 = substr($result,6,2); $template->param(index => $index, - "f1$f1" => 1, + "f1".($f1 eq '-'?'s':'n') => 1, f2 => $f2, f3 => $f3, f4 => $f4); diff --git a/cataloguing/value_builder/unimarc_field_123j.pl b/cataloguing/value_builder/unimarc_field_123j.pl index 9b0903eb43..8ce202e654 100755 --- a/cataloguing/value_builder/unimarc_field_123j.pl +++ b/cataloguing/value_builder/unimarc_field_123j.pl @@ -75,7 +75,7 @@ sub plugin { my ($template, $loggedinuser, $cookie) = get_template_and_user( { - template_name => "cataloguing/value_builder/unimarc_field_123j.tt", + template_name => "cataloguing/value_builder/unimarc_field_123i_j.tt", query => $input, type => "intranet", authnotrequired => 0, @@ -88,7 +88,7 @@ sub plugin { my $f3 = substr($result,4,2); my $f4 = substr($result,6,2); $template->param(index => $index, - "f1$f1" => 1, + "f1".($f1 eq '-'?'s':'n') => 1, f2 => $f2, f3 => $f3, f4 => $f4); diff --git a/cataloguing/value_builder/unimarc_field_210c_bis.pl b/cataloguing/value_builder/unimarc_field_210c_bis.pl index ab8d41adcf..d9e02b2275 100755 --- a/cataloguing/value_builder/unimarc_field_210c_bis.pl +++ b/cataloguing/value_builder/unimarc_field_210c_bis.pl @@ -36,8 +36,6 @@ It need : if the biblio has no isbn, then the search if done on editor only If the biblio ha an isbn, the search is done on isbn and editor. It's faster. -=over 2 - =cut use strict; @@ -50,7 +48,9 @@ use C4::Context; use C4::AuthoritiesMarc; use C4::Output; -=head1 +=head1 FUNCTIONS + +=head2 plugin_parameters plugin_parameters : other parameters added when the plugin is called by the dopop function @@ -89,7 +89,6 @@ sub plugin { my $result = $input->param('result'); my $editor_found = $input->param('editor_found'); my $AuthoritySeparator = C4::Context->preference("AuthoritySeparator"); - warn Data::Dumper::Dumper $index; my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "cataloguing/value_builder/unimarc_field_210c_bis.tt", diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt new file mode 100644 index 0000000000..898953da62 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_123i_j.tt @@ -0,0 +1,57 @@ +[% INCLUDE 'doc-head-open.inc' %] +UNIMARC field 123i/j builder +[% INCLUDE 'doc-head-close.inc' %] + + +

UNIMARC field 123i/j builder

+
+ + + + + + + + + + + + + + +
+ +
+
Cancel
+
+ + +[% INCLUDE 'popup-bottom.inc' %] -- 2.39.5