Browse Source

Bug 14201: Plugin marc21_leader_book is useless

A closer look at this plugin revealed the following:
[1] The leader_book builder redirects to leader.pl; the launcher code with
    leader_book.tt is dead.
[2] A diff of the two templates showed that most changes are minimal and
    irrelevant. Some updates to leader have not been incorporated into
    the unused leader_book.
[3] Leader_book does not use Focus while leader does.

This patch removes all traces of leader_book :)
It includes a tiny db revision for those brave people using it. The only
behavior change for them is the focus change.
Another small change: we do not need Search.pm in marc21_leader.

Test plan:
[1] Run the db revision. If you had some field attached to leader_book,
    it should be gone.
[2] Check if the leader plugin still works as expected.
[3] Run the FrameworkPlugin unit test. Ignore warnings from field_007.
[4] Git grep on marc21_leader_book. You will only find references to
    PO files in misc/translator.

Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@unc.edu.ar>
3.22.x
Marcel de Rooy 9 years ago
committed by Tomas Cohen Arazi
parent
commit
4c2e4cd0ab
  1. 9
      cataloguing/value_builder/marc21_leader.pl
  2. 91
      cataloguing/value_builder/marc21_leader_book.pl
  3. 2
      installer/data/mysql/atomicupdate/14201_marc21_leader_book.sql
  4. 338
      koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_book.tt

9
cataloguing/value_builder/marc21_leader.pl

@ -20,12 +20,10 @@
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use CGI qw ( -utf8 );
use C4::Auth;
use CGI qw ( -utf8 );
use C4::Context;
use C4::Search;
use C4::Output;
my $builder = sub {
@ -39,14 +37,13 @@ function Focus$function_name(event) {
if(!document.getElementById(event.data.id).value){
document.getElementById(event.data.id).value = ' nam a22 7a 4500';
}
return 1;
}
function Click$function_name(event) {
defaultvalue=document.getElementById(event.data.id).value;
newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
}
//]]>
</script>
";
@ -94,4 +91,4 @@ my $launcher = sub {
output_html_with_http_headers $input, $cookie, $template->output;
};
return { builder => $builder, launcher => $launcher };
return { builder => $builder, launcher => $launcher };

91
cataloguing/value_builder/marc21_leader_book.pl

@ -1,91 +0,0 @@
#!/usr/bin/perl
# Converted to new plugin style (Bug 13437)
# Copyright 2000-2002 Katipo Communications
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
use Modern::Perl;
use C4::Auth;
use CGI qw ( -utf8 );
use C4::Context;
use C4::Search;
use C4::Output;
my $builder = sub {
my ( $params ) = @_;
my $function_name = $params->{id};
my $res = "
<script type=\"text/javascript\">
//<![CDATA[
function Click$function_name(event) {
defaultvalue=document.getElementById(event.data.id).value;
newin=window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+ event.data.id +\"&result=\"+defaultvalue,\"tag_editor\",'width=1000,height=600,toolbar=false,scrollbars=yes');
}
//]]>
</script>
";
return $res;
};
my $launcher = sub {
my ( $params ) = @_;
my $input = $params->{cgi};
my $index = $input->param('index');
my $result = $input->param('result');
my $dbh = C4::Context->dbh;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{ template_name => "cataloguing/value_builder/marc21_leader.tt",
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => { editcatalogue => '*' },
debug => 1,
}
);
$result = " nam 7a " unless $result;
my $f5 = substr( $result, 5, 1 );
my $f6 = substr( $result, 6, 1 );
my $f7 = substr( $result, 7, 1 );
my $f8 = substr( $result, 8, 1 );
my $f9 = substr( $result, 9, 1 );
my $f17 = substr( $result, 17, 1 );
my $f18 = substr( $result, 18, 1 );
my $f19 = substr( $result, 19, 1 );
$template->param(
index => $index,
"f5$f5" => 1,
"f6$f6" => 1,
"f7$f7" => 1,
"f8$f8" => 1,
"f9$f9" => 1,
"f17$f17" => 1,
"f18$f18" => 1,
"f19$f19" => 1,
);
output_html_with_http_headers $input, $cookie, $template->output;
};
return { builder => $builder, launcher => $launcher };

2
installer/data/mysql/atomicupdate/14201_marc21_leader_book.sql

@ -0,0 +1,2 @@
-- move marc21_leader_book to marc21_leader
update marc_subfield_structure set value_builder='marc21_leader.pl' where value_builder='marc21_leader_book.pl';

338
koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/marc21_leader_book.tt

@ -1,338 +0,0 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Cataloging &rsaquo; Leader builder</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="cat_marc21_leader_book" class="cat" style="padding:1em;">
<form name="f_pop" onsubmit="report()" action="">
<input type="hidden" name="plugin_name" value="marc21_leader_book.pl" />
<table>
<tr>
<td>1-4 Record size</td>
<td>(auto-filled)</td>
</tr>
<tr>
<td>5- Record status</td>
<td>
<select name="f5" id="f5" size="1">
[% IF ( f5a ) %]
<option value=" " selected="selected">a- Increase in encoding level</option>
[% ELSE %]
<option value=" ">a- Increase in encoding level</option>
[% END %]
[% IF ( f5c ) %]
<option value="c" selected="selected">c- Corrected or revised</option>
[% ELSE %]
<option value="c">c- Corrected or revised</option>
[% END %]
[% IF ( f5d ) %]
<option value="d" selected="selected">d- Deleted</option>
[% ELSE %]
<option value="d">d- Deleted</option>
[% END %]
[% IF ( f5n ) %]
<option value="n" selected="selected">n- New</option>
[% ELSE %]
<option value="n">n- New</option>
[% END %]
[% IF ( f5p ) %]
<option value="p" selected="selected">p- Increase in encoding level from prepublication</option>
[% ELSE %]
<option value="p">p- Increase in encoding level from prepublication</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>6- Type of record</td>
<td>
<select name="f6" id="f6" size="1">
[% IF ( f6a ) %]
<option value="a" selected="selected">a- Language material (monography)</option>
[% ELSE %]
<option value="a">a- Language material (monography)</option>
[% END %]
[% IF ( f6c ) %]
<option value="c" selected="selected">c- Notated music</option>
[% ELSE %]
<option value="c">c- Notated music</option>
[% END %]
[% IF ( f6d ) %]
<option value="d" selected="selected">d- Manuscript notated music</option>
[% ELSE %]
<option value="d">d- Manuscript notated music</option>
[% END %]
[% IF ( f6e ) %]
<option value="e" selected="selected">e- Cartographic material</option>
[% ELSE %]
<option value="e">e- Cartographic material</option>
[% END %]
[% IF ( f6f ) %]
<option value="f" selected="selected">f - Manuscript cartographic material</option>
[% ELSE %]
<option value="f">f - Manuscript cartographic material</option>
[% END %]
[% IF ( f6g ) %]
<option value="g" selected="selected">g - Projected medium</option>
[% ELSE %]
<option value="g">g - Projected medium</option>
[% END %]
[% IF ( f6i ) %]
<option value="i" selected="selected">i - Nonmusical sound recording</option>
[% ELSE %]
<option value="i">i - Nonmusical sound recording</option>
[% END %]
[% IF ( f6j ) %]
<option value="j" selected="selected">j - Musical sound recording</option>
[% ELSE %]
<option value="j">j - Musical sound recording</option>
[% END %]
[% IF ( f6k ) %]
<option value="k" selected="selected">k - Two-dimensional nonprojectable graphic</option>
[% ELSE %]
<option value="k">k - Two-dimensional nonprojectable graphic</option>
[% END %]
[% IF ( f6m ) %]
<option value="m" selected="selected">m - Computer file</option>
[% ELSE %]
<option value="m">m - Computer file</option>
[% END %]
[% IF ( f6o ) %]
<option value="o" selected="selected">o - Kit</option>
[% ELSE %]
<option value="o">o - Kit</option>
[% END %]
[% IF ( f6r ) %]
<option value="r" selected="selected">r - Three-dimensional artifact or naturally occurring object</option>
[% ELSE %]
<option value="r">r - Three-dimensional artifact or naturally occurring object</option>
[% END %]
[% IF ( f6t ) %]
<option value="t" selected="selected">t - Manuscript language material</option>
[% ELSE %]
<option value="t">t - Manuscript language material</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>7- Bibliographic level</td>
<td>
<select name="f7" id="f7" size="1">
[% IF ( f7a ) %]
<option value="a" selected="selected">a- Monographic component part</option>
[% ELSE %]
<option value="a">a- Monographic component part</option>
[% END %]
[% IF ( f7b ) %]
<option value="b" selected="selected">b- Serial component part</option>
[% ELSE %]
<option value="b">a- Serial component part</option>
[% END %]
[% IF ( f7c ) %]
<option value="c" selected="selected">c- Collection</option>
[% ELSE %]
<option value="c">c- Collection</option>
[% END %]
[% IF ( f7d ) %]
<option value="d" selected="selected">d- Subunit</option>
[% ELSE %]
<option value="d">d- Subunit</option>
[% END %]
[% IF ( f7i ) %]
<option value="i" selected="selected">i- Integrating resource</option>
[% ELSE %]
<option value="i">i- Integrating resource</option>
[% END %]
[% IF ( f7m ) %]
<option value="m" selected="selected">m- Monograph/item</option>
[% ELSE %]
<option value="m">m- Monograph/item</option>
[% END %]
[% IF ( f7s ) %]
<option value="s" selected="selected">s- Serial</option>
[% ELSE %]
<option value="s">s- Serial</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>8- Hierarchic level</td>
<td>
<select name="f8" id="f8" size="1">
[% IF ( f8 ) %]
<option value=" " selected="selected">No specific type</option>
[% ELSE %]
<option value=" ">No specific type</option>
[% END %]
[% IF ( f8a ) %]
<option value="a" selected="selected">a- Archival</option>
[% ELSE %]
<option value="a">a- Archival</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>9- Encoding</td>
<td>
<select name="f9" id="f9" size="1">
[% IF ( f9 ) %]
<option value=" " selected="selected">MARC-8</option>
[% ELSE %]
<option value=" ">MARC-8</option>
[% END %]
[% IF ( f9a ) %]
<option value="a" selected="selected">a- UCS/Unicode</option>
[% ELSE %]
<option value="a">a- UCS/Unicode</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>10-16 indicator/subfields/size</td>
<td>(auto-filled)</td>
<tr>
<td>17- Encoding</td>
<td>
<select name="f17" id="f17" size="1">
[% IF ( f17 ) %]
<option value=" " selected="selected">full level</option>
[% ELSE %]
<option value=" ">Full level</option>
[% END %]
[% IF ( f171 ) %]
<option value="1" selected="selected">1- Full level, material not examined</option>
[% ELSE %]
<option value="1">1- Full level, material not examined</option>
[% END %]
[% IF ( f172 ) %]
<option value="2" selected="selected">2 - Less-than-full level, material not examined</option>
[% ELSE %]
<option value="2">2 - Less-than-full level, material not examined</option>
[% END %]
[% IF ( f173 ) %]
<option value="3" selected="selected">3- Abbreviated level</option>
[% ELSE %]
<option value="3">3- Abbreviated level</option>
[% END %]
[% IF ( f174 ) %]
<option value="4" selected="selected">4- Core level</option>
[% ELSE %]
<option value="4">4- Core level</option>
[% END %]
[% IF ( f175 ) %]
<option value="5" selected="selected">5- Partial (preliminary) level</option>
[% ELSE %]
<option value="5">5- Partial (preliminary) level</option>
[% END %]
[% IF ( f177 ) %]
<option value="7" selected="selected">7- Minimal level</option>
[% ELSE %]
<option value="7">7- Minimal level</option>
[% END %]
[% IF ( f178 ) %]
<option value="8" selected="selected">8- Prepublication level</option>
[% ELSE %]
<option value="8">8- Prepublication level</option>
[% END %]
[% IF ( f17u ) %]
<option value="u" selected="selected">u - Unknown</option>
[% ELSE %]
<option value="u">u - Unknown</option>
[% END %]
[% IF ( f17z ) %]
<option value="z" selected="selected">z- Not applicable</option>
[% ELSE %]
<option value="z">z- Not applicableFull level</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>18 - Descriptive cataloging form</td>
<td>
<select name="f18" id="f18" size="1">
[% IF ( f18 ) %]
<option value=" " selected="selected">Non-ISBD</option>
[% ELSE %]
<option value=" ">Non-ISBD</option>
[% END %]
[% IF ( f18a ) %]
<option value="a" selected="selected">a- AACR 2</option>
[% ELSE %]
<option value="a">a- AACR 2</option>
[% END %]
[% IF ( f18c ) %]
<option value="c" selected="selected">c- ISBD punctuation omitted</option>
[% ELSE %]
<option value="c">c- ISBD punctuation omitted</option>
[% END %]
[% IF ( f18i ) %]
<option value="i" selected="selected">i- ISBD punctuation included</option>
[% ELSE %]
<option value="i">i- ISBD punctuation included</option>
[% END %]
[% IF ( f18u ) %]
<option value="u" selected="selected">u- Unknown</option>
[% ELSE %]
<option value="u">u- Unknown</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>19 - Linked record requirement</td>
<td>
<select name="f19" id="f19" size="1">
[% IF ( f19 ) %]
<option value=" " selected="selected">Related record not required</option>
[% ELSE %]
<option value=" ">Related record not required</option>
[% END %]
[% IF ( f18r ) %]
<option value="r" selected="selected">r- Related record required</option>
[% ELSE %]
<option value="r">r- Related record required</option>
[% END %]
</select>
</td>
</tr>
<tr>
<td>20-24 entry map &amp; lengths</td>
<td>(auto-filled)</td>
<tr>
</table>
<fieldset class="action"><input type="submit" value="OK" /> <a href="#" class="cancel close">Cancel</a></fieldset>
</form>
<script type="text/javascript">//<![CDATA[
function report() {
var doc = opener.document;
var field = doc.getElementById("[% index %]");
field.value =
' '+
document.f_pop.f5.value+
document.f_pop.f6.value+
document.f_pop.f7.value+
document.f_pop.f8.value+
document.f_pop.f9.value+
'22 '+
document.f_pop.f17.value+
document.f_pop.f18.value+
document.f_pop.f19.value+
'4500';
self.close();
return false;
}
//]]>
</script>
[% INCLUDE 'popup-bottom.inc' %]
Loading…
Cancel
Save