3 # written 10/5/2002 by Paul
5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
32 plugin unimarc_field_700-4
36 This plug-in deals with unimarc field 700-4 (
46 sub plugin_parameters {
47 my ($dbh,$record,$tagslib,$morethan,$begin_tabloop) = @_;
48 my $index2; # the resulting index
50 # loop to find 700$a subfield. We look for the 1st after $i
51 for (my $tabloop = $begin_tabloop; $tabloop<=9;$tabloop++) {
53 foreach my $tag (keys %{$tagslib}) {
54 # loop through each subfield
55 foreach my $subfield (keys %{$tagslib->{$tag}}) {
56 next if ($subfield eq 'lib'); # skip lib and tabs, which are koha internal
57 next if ($subfield eq 'tab');
58 next if ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop);
59 if ($tag eq '700' && $subfield eq 'a' && $i>$morethan) {
67 return "&index2=$index2";
70 sub plugin_javascript {
71 my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
79 # my $input = new CGI;
80 my $index= $input->param('index');
81 my $index2= $input->param('index2');
82 $index2=-1 unless($index2);
83 my $result= $input->param('result');
86 my $dbh = C4::Context->dbh;
88 my ($template, $loggedinuser, $cookie)
89 = get_template_and_user({template_name => "value_builder/unimarc_field_700-4.tmpl",
93 flagsrequired => {parameters => 1},
96 $template->param(index => $index,
98 "f1_$result" => "f1_".$result,
100 print $input->header(-cookie => $cookie),$template->output;