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 <jonathan.druart@biblibre.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Checked plugin in a UNIMARC installation.

Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
This commit is contained in:
Marcel de Rooy 2014-10-20 12:36:36 +02:00 committed by Tomas Cohen Arazi
parent 52c40e1129
commit 7cbbbb04df
4 changed files with 64 additions and 8 deletions

View file

@ -72,7 +72,7 @@ my ($input) = @_;
my $dbh = C4::Context->dbh; my $dbh = C4::Context->dbh;
my ($template, $loggedinuser, $cookie) 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, query => $input,
type => "intranet", type => "intranet",
authnotrequired => 0, authnotrequired => 0,
@ -84,7 +84,7 @@ my ($template, $loggedinuser, $cookie)
my $f3 = substr($result,4,2); my $f3 = substr($result,4,2);
my $f4 = substr($result,6,2); my $f4 = substr($result,6,2);
$template->param(index => $index, $template->param(index => $index,
"f1$f1" => 1, "f1".($f1 eq '-'?'s':'n') => 1,
f2 => $f2, f2 => $f2,
f3 => $f3, f3 => $f3,
f4 => $f4); f4 => $f4);

View file

@ -75,7 +75,7 @@ sub plugin {
my ($template, $loggedinuser, $cookie) my ($template, $loggedinuser, $cookie)
= get_template_and_user( = 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, query => $input,
type => "intranet", type => "intranet",
authnotrequired => 0, authnotrequired => 0,
@ -88,7 +88,7 @@ sub plugin {
my $f3 = substr($result,4,2); my $f3 = substr($result,4,2);
my $f4 = substr($result,6,2); my $f4 = substr($result,6,2);
$template->param(index => $index, $template->param(index => $index,
"f1$f1" => 1, "f1".($f1 eq '-'?'s':'n') => 1,
f2 => $f2, f2 => $f2,
f3 => $f3, f3 => $f3,
f4 => $f4); f4 => $f4);

View file

@ -36,8 +36,6 @@ It need :
if the biblio has no isbn, then the search if done on editor only 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. If the biblio ha an isbn, the search is done on isbn and editor. It's faster.
=over 2
=cut =cut
use strict; use strict;
@ -50,7 +48,9 @@ use C4::Context;
use C4::AuthoritiesMarc; use C4::AuthoritiesMarc;
use C4::Output; use C4::Output;
=head1 =head1 FUNCTIONS
=head2 plugin_parameters
plugin_parameters : other parameters added when the plugin is called by the dopop function 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 $result = $input->param('result');
my $editor_found = $input->param('editor_found'); my $editor_found = $input->param('editor_found');
my $AuthoritySeparator = C4::Context->preference("AuthoritySeparator"); my $AuthoritySeparator = C4::Context->preference("AuthoritySeparator");
warn Data::Dumper::Dumper $index;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "cataloguing/value_builder/unimarc_field_210c_bis.tt", { template_name => "cataloguing/value_builder/unimarc_field_210c_bis.tt",

View file

@ -0,0 +1,57 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>UNIMARC field 123i/j builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="cat_unimarc_field_123ij" class="cat" style="padding:1em;">
<h3>UNIMARC field 123i/j builder</h3>
<form name="f_pop" action="">
<table>
<tr>
<td><label for="f1">Hemisphere:</label></td>
<td>
<select name="f1" id="f1" size="1">
[% IF ( f1n ) %]
<option value="+" selected="selected">north</option>
[% ELSE %]
<option value="+">north</option>
[% END %]
[% IF ( f1s ) %]
<option value="-" selected="selected">south</option>
[% ELSE %]
<option value="-">south</option>
[% END %]
</select>
</td></tr>
<tr> <td><label for="f2">Degree (complete with 0):</label></td>
<td><input type="text" name="f2" id="f2" maxlength="3" size="4" value="[% f2 %]" /></td>
</tr>
<tr> <td><label for="f3">Minute (complete with 0):</label></td>
<td><input type="text" name="f3" id="f3" maxlength="2" size="3" value="[% f3 %]" /></td>
</tr>
<tr> <td><label for="f4">Second (complete with 0):</label></td>
<td><input type="text" name="f4" id="f4" maxlength="2" size="3" value="[% f4 %]" /></td>
</tr>
</table>
<fieldset class="action"><input type="button" value="OK" onclick="report();" /> <a href="#" class="cancel close">Cancel</a></fieldset>
</form>
<script type="text/javascript">
//<![CDATA[
function report() {
var f2= "000" + document.f_pop.f2.value;
f2 = f2.substring(f2.length-3);
var f3= "00" + document.f_pop.f3.value;
f3 = f3.substring(f3.length-2);
var f4= "00" + document.f_pop.f4.value;
f4 = f4.substring(f4.length-2);
var doc = opener.document;
var field = doc.getElementById("[% index %]");
field.value = document.f_pop.f1.value+ f2 + f3 + f4;
window.close();
return false;
}
//]]>
</script>
[% INCLUDE 'popup-bottom.inc' %]