[Koha-cvs] koha/cataloguing/value_builder labs_theses.pl m... [rel_3_0]

Antoine Farnault antoine at koha-fr.org
Tue Sep 12 17:50:07 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		rel_3_0
Changes by:	Antoine Farnault <toins>	06/09/12 15:50:06

Added files:
	cataloguing/value_builder: labs_theses.pl marc21_field_003.pl 
	                           marc21_field_005.pl 
	                           marc21_field_006.pl 
	                           marc21_field_007.pl 
	                           marc21_field_008.pl 
	                           marc21_field_008_authorities.pl 
	                           marc21_leader.pl 
	                           marc21_leader_authorities.pl 
	                           marc21_leader_book.pl 
	                           marc21_leader_computerfile.pl 
	                           marc21_leader_video.pl 
	                           unimarc_field_100.pl 
	                           unimarc_field_105.pl 
	                           unimarc_field_106.pl 
	                           unimarc_field_110.pl 
	                           unimarc_field_115a.pl 
	                           unimarc_field_115b.pl 
	                           unimarc_field_116.pl 
	                           unimarc_field_117.pl 
	                           unimarc_field_120.pl 
	                           unimarc_field_121a.pl 
	                           unimarc_field_121b.pl 
	                           unimarc_field_122.pl 
	                           unimarc_field_123a.pl 
	                           unimarc_field_123d.pl 
	                           unimarc_field_123e.pl 
	                           unimarc_field_123f.pl 
	                           unimarc_field_123g.pl 
	                           unimarc_field_123i.pl 
	                           unimarc_field_123j.pl 
	                           unimarc_field_124.pl 
	                           unimarc_field_124a.pl 
	                           unimarc_field_124b.pl 
	                           unimarc_field_124c.pl 
	                           unimarc_field_124d.pl 
	                           unimarc_field_124e.pl 
	                           unimarc_field_124f.pl 
	                           unimarc_field_124g.pl 
	                           unimarc_field_125.pl 
	                           unimarc_field_125a.pl 
	                           unimarc_field_125b.pl 
	                           unimarc_field_126.pl 
	                           unimarc_field_126a.pl 
	                           unimarc_field_126b.pl 
	                           unimarc_field_127.pl 
	                           unimarc_field_128a.pl 
	                           unimarc_field_128b.pl 
	                           unimarc_field_128c.pl 
	                           unimarc_field_130.pl 
	                           unimarc_field_135a.pl 
	                           unimarc_field_140.pl 
	                           unimarc_field_141.pl 
	                           unimarc_field_210c.pl 
	                           unimarc_field_225a.pl 
	                           unimarc_field_4XX.pl 
	                           unimarc_field_60X.pl 
	                           unimarc_field_700-4.pl 
	                           unimarc_field_700_701_702.pl 
	                           unimarc_leader.pl 
	                           usmarc_field_952v.pl 

Log message:
	adding value builder in rel_3_0.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/labs_theses.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_field_003.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_field_005.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_field_006.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_field_007.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_field_008.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_field_008_authorities.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_leader.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_leader_authorities.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_leader_book.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_leader_computerfile.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/marc21_leader_video.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_100.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_105.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_106.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_110.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_115a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_115b.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_116.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_117.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_120.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_121a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_121b.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_122.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123d.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123e.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123f.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123g.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123i.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_123j.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124b.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124c.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124d.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124e.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124f.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_124g.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_125.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_125a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_125b.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_126.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_126a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_126b.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_127.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_128a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_128b.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_128c.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_130.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_135a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_140.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_141.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_210c.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_225a.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_4XX.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_60X.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_700-4.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_700_701_702.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_leader.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1
http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/usmarc_field_952v.pl?cvsroot=koha&only_with_tag=rel_3_0&rev=1.1.2.1

Patches:
Index: labs_theses.pl
===================================================================
RCS file: labs_theses.pl
diff -N labs_theses.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ labs_theses.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,186 @@
+#!/usr/bin/perl
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+require Exporter;
+use CGI;
+use HTML::Template;
+use C4::Interface::CGI::Output;
+use C4::Context;
+use C4::Auth;
+use C4::Output;
+use C4::Database;
+use C4::Koha;
+
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "328".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.f.field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=labs_theses.pl&cat_auth=LABTHE&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 328\",'width=700,height=700,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+
+sub plugin {
+	my ($input) = @_;
+	my %env;
+	
+	
+	my $dbh=C4::Context->dbh;
+	my $query = new CGI;
+	my $op = $query->param('op');
+	my $cat_auth=$query->param('cat_auth');
+
+	my $startfrom=$query->param('startfrom');
+	$startfrom=0 if(!defined $startfrom);
+	my ($template, $loggedinuser, $cookie);
+	my $resultsperpage;
+	my $search = $query->param('search');
+	
+	if ($op eq "do_search") {
+	
+		$resultsperpage= $query->param('resultsperpage');
+		$resultsperpage = 19 if(!defined $resultsperpage);
+# 		my $upperlimit=$startfrom+$resultsperpage;
+		# builds tag and subfield arrays
+		my $strquery = "SELECT authorised_value, lib from authorised_values where category = ? and lib like ?";
+# 		$strquery .= " LIMIT $startfrom,$upperlimit";
+		
+		warn 'category : '.$cat_auth.' recherche :'.$search;
+		warn "$strquery";
+		$search=~s/\*/%/g;
+		my $sth = $dbh->prepare($strquery);
+		$sth->execute($cat_auth,$search);
+		$search=~s/%/\*/g;
+		
+		
+		my @results;
+		my $total;
+		while (my $data = $sth->fetchrow_hashref){
+			my $libjs=$data->{'lib'};
+			$libjs=~s#\'#\\\'#g;
+			my $authjs=$data->{'authorised_value'};
+			$authjs=~s#\'#\\\'#g;
+			push @results, {'libjs'=>$libjs,
+							'lib'=>$data->{'lib'},
+							'authjs'=>$authjs,
+							'auth_value'=>$data->{'authorised_value'}} 
+							unless (($total<$startfrom) or ($total>$startfrom+$resultsperpage));
+			$total++;
+		}
+		
+		($template, $loggedinuser, $cookie)
+			= get_template_and_user({template_name => "value_builder/labs_theses.tmpl",
+					query => $query,
+					type => 'intranet',
+					authnotrequired => 1,
+					debug => 1,
+					});
+	
+		# multi page display gestion
+		my $displaynext=0;
+		my $displayprev=$startfrom;
+		if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){
+			$displaynext = 1;
+		}
+	
+		my @numbers = ();
+	
+		if ($total>$resultsperpage)
+		{
+			for (my $i=1; (($i<$total/$resultsperpage+1) && ($i<16)); $i++)
+			{
+					my $highlight=0;
+					($startfrom==($i-1)) && ($highlight=1);
+					push @numbers, { number => $i,
+						highlight => $highlight ,
+						search=> $search,
+						startfrom => $resultsperpage*($i-1)};
+			}
+		}
+	
+		my $from = $startfrom+1;
+		my $to;
+	
+		if($total < (($startfrom+1)*$resultsperpage))
+		{
+			$to = $total;
+		} else {
+			$to = (($startfrom+1)*$resultsperpage);
+		}
+ 		$template->param(catresult => \@results,
+ 						cat_auth=>$cat_auth,
+ 						index => $query->param('index')."",
+ 								startfrom=> $startfrom,
+								displaynext=> $displaynext,
+								displayprev=> $displayprev,
+								resultsperpage => $resultsperpage,
+								startfromnext => $startfrom+$resultsperpage,
+								startfromprev => $startfrom-$resultsperpage,
+								search=>$search,
+								total=>$total,
+								from=>$from,
+								to=>$to,
+								numbers=>\@numbers,
+								resultlist=>1
+								);
+	
+	} else {
+		($template, $loggedinuser, $cookie)
+			= get_template_and_user({template_name => "value_builder/labs_theses.tmpl",
+						query => $query,
+						type => "intranet",
+						authnotrequired => 1,
+					});
+		
+		$template->param(
+						'search'=>$query->param('search'),
+		);
+		$template->param(
+						'index'=>''.$query->param('index')
+		) if ($query->param('index'));
+		warn 'index : '.$query->param('index');
+		$template->param(
+ 						'cat_auth'=>$cat_auth
+		) if ($cat_auth);
+	}	
+	output_html_with_http_headers $query, $cookie, $template->output ;
+}
+
+1;

Index: marc21_field_003.pl
===================================================================
RCS file: marc21_field_003.pl
diff -N marc21_field_003.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_field_003.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_003.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+require Exporter;
+use C4::AuthoritiesMarc;
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use MARC::Record;
+use C4::Koha;
+use HTML::Template;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+=head1
+
+plugin_javascript : the javascript function called when the user enters the subfield.
+contain 3 javascript functions :
+* one called when the field is entered (OnFocus). Named FocusXXX
+* one called when the field is leaved (onBlur). Named BlurXXX
+* one called when the ... link is clicked (<a href="javascript:function">) named ClicXXX
+
+returns :
+* XXX
+* a variable containing the 3 scripts.
+the 3 scripts are inserted after the <input> in the html code
+
+=cut
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "003".(int(rand(100000))+1);
+
+# find today's date
+my $org = C4::Context->preference('MARCOrgCode');
+my $res  = "
+<script>
+function Blur$function_name(index) {
+//need this?
+}
+
+function Focus$function_name(subfield_managed) {
+	for (i=0 ; i<document.f.field_value.length ; i++) {
+                if (document.f.tag[i].value == '003') {
+                        document.f.field_value[i].value = '$org';
+                }
+        }
+return 0;
+}
+
+function Clic$function_name(subfield_managed) {
+}
+</script>
+";
+return ($function_name,$res);
+}
+
+=head1
+
+plugin : the true value_builded. The screen that is open in the popup window.
+
+=cut
+
+sub plugin {
+my ($input) = @_;
+return "";
+}
+
+1;

Index: marc21_field_005.pl
===================================================================
RCS file: marc21_field_005.pl
diff -N marc21_field_005.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_field_005.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,118 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_005.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+require Exporter;
+use C4::AuthoritiesMarc;
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use MARC::Record;
+use C4::Koha;
+use HTML::Template;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+=head1
+
+plugin_javascript : the javascript function called when the user enters the subfield.
+contain 3 javascript functions :
+* one called when the field is entered (OnFocus). Named FocusXXX
+* one called when the field is leaved (onBlur). Named BlurXXX
+* one called when the ... link is clicked (<a href="javascript:function">) named ClicXXX
+
+returns :
+* XXX
+* a variable containing the 3 scripts.
+the 3 scripts are inserted after the <input> in the html code
+
+=cut
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "210c".(int(rand(100000))+1);
+
+# find today's date
+my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+                                                               localtime(time);
+$year +=1900;
+$mon +=1;
+if (length($mon)==1) {
+	$mon = "0".$mon;
+}
+if (length($mday)==1) {
+	$mday = "0".$mday;
+}
+if (length($hour)==1) {
+        $hour = "0".$hour;
+}
+if (length($min)==1) {
+        $min = "0".$min;
+}
+if (length($sec)==1) {
+        $hour = "0".$sec;
+}
+
+
+my $date = "$year$mon$mday$hour$min$sec".".0";
+my $res  = "
+<script>
+function Blur$function_name(index) {
+//need this?
+}
+
+function Focus$function_name(subfield_managed) {
+	for (i=0 ; i<document.f.field_value.length ; i++) {
+                if (document.f.tag[i].value == '005') {
+                        document.f.field_value[i].value = '$date';
+                }
+        }
+return 0;
+}
+
+function Clic$function_name(subfield_managed) {
+}
+</script>
+";
+return ($function_name,$res);
+}
+
+=head1
+
+plugin : the true value_builded. The screen that is open in the popup window.
+
+=cut
+
+sub plugin {
+my ($input) = @_;
+return "";
+}
+
+1;

Index: marc21_field_006.pl
===================================================================
RCS file: marc21_field_006.pl
diff -N marc21_field_006.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_field_006.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_006.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms['f'].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_field_006.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_field_006.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "a|||||r|||| 00| 0 " unless $result;
+#	$result = "a     r     00  0 " unless $result;
+	my $f0 = substr($result,0,1);
+	my $f014 = substr($result,1,4);
+	my $f5 = substr($result,5,1);
+	my $f6 = substr($result,6,1);
+	my $f710 = substr($result,7,4);
+	my $f11 = substr($result,11,1);
+	my $f12 = substr($result,12,1);
+	my $f13 = substr($result,13,1);
+	my $f14 = substr($result,14,1);
+	my $f15 = substr($result,15,1);
+	my $f16 = substr($result,16,1);
+	my $f17 = substr($result,17,1);
+
+	$template->param(				index => $index,
+							f0 => $f0,
+							"f0$f0" => $f0,
+							f014 => $f014,
+							"f014$f014" => $f014,
+							f5 => $f5,
+							"f5$f5" => $f5,
+							f6 => $f6,
+							"f6$f6" => $f6,
+							f710 => $f710,
+							"f710$f710" => $f710,
+							f11 => $f11,
+                                                        "f11$f11" => $f11,
+							f12 => $f12,
+							"f12$f12" => $f12,
+							f13 => $f13,
+                                                        "f13$f13" => $f13,
+							f14 => $f14,
+                                                        "f14$f14" => $f14,
+							f15 => $f15,
+                                                        "f15$f15" => $f15,
+							f16 => $f16,
+                                                        "f16$f16" => $f16,
+							f17 => $f17,
+							"f17$f17" => $f17,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_field_007.pl
===================================================================
RCS file: marc21_field_007.pl
diff -N marc21_field_007.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_field_007.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,95 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_007.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms['f'].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_field_007.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_field_007.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "ta" unless $result;
+	my $f0 = substr($result,0,1);
+	my $f1 = substr($result,1,4);
+
+	$template->param(				index => $index,
+							f0 => $f0,
+							"f0$f0" => $f0,
+							f1 => $f1,
+                                                        "f1$f1" => $f1,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_field_008.pl
===================================================================
RCS file: marc21_field_008.pl
diff -N marc21_field_008.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_field_008.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,154 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_008.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+# find today's date
+my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time); 
+
+$year +=1900; $mon +=1;
+my $dateentered = substr($year,2,2).sprintf ("%0.2d", $mon).sprintf ("%0.2d",$mday);
+sub plugin_parameters {
+	my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+	return "";
+}
+
+sub plugin_javascript {
+	my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+	my $function_name= "100".(int(rand(100000))+1);
+	my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+    for (i=0 ; i<document.f.field_value.length ; i++) {
+        if (document.f.tag[i].value == '008') {
+            if (!document.f.field_value[i].value) {
+                document.f.field_value[i].value = '$dateentered' + 't        xxu||||| |||| 00| 0 eng d';
+            }
+        }
+    }
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms['f'].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_field_008.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+	return ($function_name,$res);
+}
+sub plugin {
+	my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_field_008.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+#	$result = "      t        xxu           00  0 eng d" unless $result;
+	$result = "$dateentered"."t        xxu||||| |||| 00| 0 eng d" unless $result;
+	my $f1 = substr($result,0,6);
+	my $f6 = substr($result,6,1);
+	my $f710 = substr($result,7,4);
+	my $f1114 = substr($result,11,4);
+	my $f1517 = substr($result,15,3);
+	my $f1821 = substr($result,18,4);
+	my $f22 = substr($result,22,1);
+	my $f23 = substr($result,23,1);
+	my $f2427 = substr($result,24,4);
+	my $f28 = substr($result,28,1);
+	my $f29 = substr($result,29,1);
+	my $f30 = substr($result,30,1);
+	my $f31 = substr($result,31,1);
+	my $f33 = substr($result,33,1);
+	my $f34 = substr($result,34,1);
+	my $f3537 = substr($result,35,3);
+	my $f38 = substr($result,38,1);
+	my $f39 = substr($result,39,1);
+
+if ((!$f1) ||($f1 =~ m/ /)){
+	$f1=$dateentered;
+}
+
+	$template->param(				index => $index,
+							f1 => $f1,
+							f6 => $f6,
+							"f6$f6" => $f6,
+							f710 => $f710,
+							f1114 => $f1114,
+							f1517 => $f1517,
+							f1821 => $f1821,
+							f22 => $f22,
+							"f22$f22" => $f22,
+							f23 => $f23,
+                                                        "f23$f23" => $f23,
+							f2427 => $f2427,
+							"f24$f2427" => $f2427,
+							f28 => $f28,
+                                                        "f28$f28" => $f28,
+							f29 => $f29,
+                                                        "f29$f29" => $f29,
+							f30 => $f30,
+                                                        "f230$f30" => $f30,
+							f31 => $f31,
+                                                        "f31$f31" => $f31,
+							f33 => $f33,
+                                                        "f33$f33" => $f33,
+							f34 => $f34,
+                                                        "f34$f34" => $f34,
+							f3537 => $f3537,
+							f38 => $f38,
+							"f38$f38" => $f38,
+							f39 => $f39,
+							"f39$f39" => $f39,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_field_008_authorities.pl
===================================================================
RCS file: marc21_field_008_authorities.pl
diff -N marc21_field_008_authorities.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_field_008_authorities.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,151 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_008_authorities.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+# find today's date
+my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+                                                               localtime(time);
+$year = substr($year,1,2);
+$mon +=1;
+my $date = "$year-$mon-$mday";
+my $res  = "";
+if (length($mon)==1) {
+	$mon='0'.$mon;
+}
+if (length($mday)==1) {
+        $mday='0'.$mday;
+}
+my $dateentered = "$year$mon$mday";
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_field_008_authorities.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_field_008_authorities.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+#	$result = "      t        xxu           00  0 eng d" unless $result;
+	$result = "      t        xxu||||| |||| 00| 0 eng d" unless $result;
+	my $f6 = substr($result,6,1);
+	my $f710 = substr($result,7,4);
+	my $f1114 = substr($result,11,4);
+	my $f1517 = substr($result,15,3);
+	my $f1821 = substr($result,18,4);
+	my $f22 = substr($result,22,1);
+	my $f23 = substr($result,23,1);
+	my $f2427 = substr($result,24,4);
+	my $f28 = substr($result,28,1);
+	my $f29 = substr($result,29,1);
+	my $f30 = substr($result,30,1);
+	my $f31 = substr($result,31,1);
+	my $f33 = substr($result,33,1);
+	my $f34 = substr($result,34,1);
+	my $f3537 = substr($result,35,3);
+	my $f38 = substr($result,38,1);
+	my $f39 = substr($result,39,1);
+
+	$template->param(				index => $index,
+							dateentered => $dateentered,
+							f6 => $f6,
+							"f6$f6" => $f6,
+							f710 => $f710,
+							f1114 => $f1114,
+							f1517 => $f1517,
+							f1821 => $f1821,
+							f22 => $f22,
+							"f22$f22" => $f22,
+							f23 => $f23,
+                                                        "f23$f23" => $f23,
+							f2427 => $f2427,
+							"f24$f2427" => $f2427,
+							f28 => $f28,
+                                                        "f28$f28" => $f28,
+							f29 => $f29,
+                                                        "f29$f29" => $f29,
+							f30 => $f30,
+                                                        "f230$f30" => $f30,
+							f31 => $f31,
+                                                        "f31$f31" => $f31,
+							f33 => $f33,
+                                                        "f33$f33" => $f33,
+							f34 => $f34,
+                                                        "f34$f34" => $f34,
+							f3537 => $f3537,
+							f38 => $f38,
+							"f38$f38" => $f38,
+							f39 => $f39,
+							"f39$f39" => $f39,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_leader.pl
===================================================================
RCS file: marc21_leader.pl
diff -N marc21_leader.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_leader.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,113 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+    for (i=0 ; i<document.f.field_value.length ; i++) {
+		if (document.f.tag[i].value == '000') {
+			if (!document.f.field_value[i].value) {
+				document.f.field_value[i].value = '     nam a22     7a 4500';
+			}
+		}
+	}
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms['f'].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_leader.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "     nam a22     7a 4500" 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);
+	my $f2023 = substr($result,20,4);
+	$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,
+							"f2023" => $f2023,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_leader_authorities.pl
===================================================================
RCS file: marc21_leader_authorities.pl
diff -N marc21_leader_authorities.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_leader_authorities.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_authorities.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_leader_authorities.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_leader_authorities.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "     nam  22     7a  4500" 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);
+	my $f2023 = substr($result,20,4);
+	$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,
+							"f2023" => $f2023,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_leader_book.pl
===================================================================
RCS file: marc21_leader_book.pl
diff -N marc21_leader_book.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_leader_book.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_book.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_leader.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "     nam         7a      " unless $result;
+	my $f5 = substr($result,5,1);
+	my $f6 = substr($result,6,1);
+	warn "F6".$f6;
+	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,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_leader_computerfile.pl
===================================================================
RCS file: marc21_leader_computerfile.pl
diff -N marc21_leader_computerfile.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_leader_computerfile.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,108 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_computerfile.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_leader_computerfile.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "     nmm         7a      " unless $result;
+	warn "RESULT:".$result;
+	my $f5 = substr($result,5,1);
+	my $f6 = substr($result,6,1);
+	warn "F6".$f6;
+	my $f7 = substr($result,7,1);
+	warn "F7:".$f7;
+	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,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: marc21_leader_video.pl
===================================================================
RCS file: marc21_leader_video.pl
diff -N marc21_leader_video.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ marc21_leader_video.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_video.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=marc21_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/marc21_leader.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "     ngm         7a      " unless $result;
+	my $f5 = substr($result,5,1);
+	my $f6 = substr($result,6,1);
+	warn "F6".$f6;
+	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,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_100.pl
===================================================================
RCS file: unimarc_field_100.pl
diff -N unimarc_field_100.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_100.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,120 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_100.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_100.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_100.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result='        d        u  y0frey03      ba' unless $result;
+	my $f1 = substr($result,0,8);
+	my $f2 = substr($result,8,1);
+	my $f3 = substr($result,9,4);
+        my $f4 = substr($result,13,4);
+	my $f5 = substr($result,17,1);
+	my $f6 = substr($result,18,1);
+	my $f7 = substr($result,19,1);
+	my $f8 = substr($result,20,1);
+	my $f9 = substr($result,21,1);
+        my $f10 = substr($result,22,3);
+	my $f11 = substr($result,25,1);
+	my $f12 = substr($result,26,2);
+	my $f13 = substr($result,28,2);
+	my $f14 = substr($result,30,4);
+        my $f15 = substr($result,34,2);
+
+
+	$template->param(index => $index,
+							f1 => $f1,
+							f3 => $f3,
+							"f2$f2" => 1,
+							f4 => $f4,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+							"f9$f9" => 1,
+							"f10" => $f10,
+							"f11$f11" => 1,
+							"f12$f12" => 1,
+							"f13$f13" => 1,
+							"f14" => $f14,
+							"f15$f15" => 1
+			                                );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_105.pl
===================================================================
RCS file: unimarc_field_105.pl
diff -N unimarc_field_105.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_105.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,114 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_105.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "105".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_105.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 105\",'width=1200,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_105.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,1);
+ 	my $f2 = substr($result,1,1);
+ 	my $f3 = substr($result,2,1);
+ 	my $f4 = substr($result,3,1);
+
+	my $f5 = substr($result,4,1);
+	my $f6 = substr($result,5,1);
+	my $f7 = substr($result,6,1);
+	my $f8 = substr($result,7,1);
+
+	my $f9  = substr($result,8,1);
+	my $f10 = substr($result,9,1);
+        my $f11 = substr($result,10,1);
+        my $f12 = substr($result,11,1);
+        my $f13 = substr($result,12,1);
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+			                "f9$f9" => 1,
+							"f10$f10" => 1,
+							"f11$f11" => 1,
+							"f12$f12" => 1,
+							"f13$f13" => 1
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_106.pl
===================================================================
RCS file: unimarc_field_106.pl
diff -N unimarc_field_106.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_106.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_106.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "106".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_106.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 106\",'width=500,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new CGI;
+	my $index= $input->param('index');
+	my $result= $input->param('result');
+
+warn ("Je suis quand meme ici\n");
+	my $dbh = C4::Context->dbh;
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => "value_builder/unimarc_field_106.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+							"f1$f1" => $f1
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_110.pl
===================================================================
RCS file: unimarc_field_110.pl
diff -N unimarc_field_110.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_110.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_110.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "110".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_110.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 110\",'width=700,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_110.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,1);
+ 	my $f2 = substr($result,1,1);
+ 	my $f3 = substr($result,2,1);
+ 	my $f4 = substr($result,3,1);
+ 	my $f5 = substr($result,4,3);
+ 	my $f6 = substr($result,7,1);
+ 	my $f7 = substr($result,8,1);
+ 	my $f8 = substr($result,9,1);
+ 	my $f9 = substr($result,10,1);
+
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							 f5 => $f5,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+							"f9$f9" => 1
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_115a.pl
===================================================================
RCS file: unimarc_field_115a.pl
diff -N unimarc_field_115a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_115a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,122 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_115a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "115a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_115a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 115a\",'width=1200,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_115a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,1);
+ 	my $f2 = substr($result,1,3);
+ 	my $f3 = substr($result,4,1);
+ 	my $f4 = substr($result,5,1);
+ 	my $f5 = substr($result,6,1);
+ 	my $f6 = substr($result,7,1);
+ 	my $f7 = substr($result,8,1);
+ 	my $f8 = substr($result,9,1);
+ 	my $f9 = substr($result,10,1);
+ 	my $f10 = substr($result,11,1);
+ 	my $f11 = substr($result,12,1);
+ 	my $f12 = substr($result,13,1);
+ 	my $f13 = substr($result,14,1);
+ 	my $f14 = substr($result,15,1);
+ 	my $f15 = substr($result,16,1);
+ 	my $f16 = substr($result,17,1);
+ 	my $f17 = substr($result,18,1);
+ 	my $f18 = substr($result,19,1);
+
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2" => $f2,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+ 							"f9$f9" => 1,
+ 							"f10$f10" => 1,
+ 							"f11$f11" => 1,
+ 							"f12$f12" => 1,
+ 							"f13$f13" => 1,
+ 							"f14$f14" => 1,
+ 							"f15$f15" => 1,
+ 							"f16$f16" => 1,
+ 							"f17$f17" => 1,
+ 							"f18$f18" => 1
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_115b.pl
===================================================================
RCS file: unimarc_field_115b.pl
diff -N unimarc_field_115b.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_115b.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,108 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_115b.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "115b".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_115b.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 115b\",'width=1200,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_115b.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,1);
+ 	my $f2 = substr($result,1,1);
+ 	my $f3 = substr($result,2,1);
+ 	my $f4 = substr($result,3,1);
+ 	my $f5 = substr($result,4,1);
+ 	my $f6 = substr($result,5,1);
+ 	my $f7 = substr($result,6,1);
+ 	my $f8 = substr($result,7,1);
+ 	my $f9 = substr($result,8,1);
+ 	my $f10 = substr($result,9,4);
+ 	my $f11 = substr($result,13,2);
+
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+ 							"f9$f9" => 1,
+ 							"f10" => $f10,
+ 							"f11" => $f11
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_116.pl
===================================================================
RCS file: unimarc_field_116.pl
diff -N unimarc_field_116.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_116.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,111 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_116.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "116".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_116.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 116\",'width=1200,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_116.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,1);
+ 	my $f2 = substr($result,1,1);
+ 	my $f3 = substr($result,2,1);
+ 	my $f4 = substr($result,3,1);
+
+ 	my $f5 = substr($result,4,2);
+ 	my $f6 = substr($result,6,2);
+ 	my $f7 = substr($result,8,2);
+
+ 	my $f8 = substr($result,10,2);
+ 	my $f9 = substr($result,12,2);
+ 	my $f10 = substr($result,14,2);
+
+ 	my $f11 = substr($result,16,2);
+
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+ 							"f9$f9" => 1,
+ 							"f10$f10" => 1,
+ 							"f11$f11" => 1
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_117.pl
===================================================================
RCS file: unimarc_field_117.pl
diff -N unimarc_field_117.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_117.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_117.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "117".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_117.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 117\",'width=600,height=225,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_117.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+ 	my $f1 = substr($result,0,2);
+ 	my $f2 = substr($result,2,2);
+ 	my $f3 = substr($result,4,2);
+ 	my $f4 = substr($result,6,2);
+
+ 	my $f5 = substr($result,8,1);
+
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1
+ );
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_120.pl
===================================================================
RCS file: unimarc_field_120.pl
diff -N unimarc_field_120.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_120.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_120.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "120".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_120.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 120\",'width=1200,height=750,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_120.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,1);
+	my $f5 = substr($result,4,1);
+	my $f6 = substr($result,5,1);
+	my $f7 = substr($result,6,1);
+	my $f8 = substr($result,7,2);
+	my $f9 = substr($result,9,2);
+	my $f10 = substr($result,11,2);
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+							"f8$f8" => 1,
+							"f9$f9" => 1,
+							"f10$f10" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_121a.pl
===================================================================
RCS file: unimarc_field_121a.pl
diff -N unimarc_field_121a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_121a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_121a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "121a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_121a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 121a\",'width=1210,height=750,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_121a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,2);
+	my $f5 = substr($result,5,1);
+	my $f6 = substr($result,6,1);
+	my $f7 = substr($result,7,1);
+	my $f8 = substr($result,8,1);
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							"f3$f3" => 1,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1,
+			 "f8$f8" => $f8);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_121b.pl
===================================================================
RCS file: unimarc_field_121b.pl
diff -N unimarc_field_121b.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_121b.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,100 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_121b.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "121b".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_121b.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 121b\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_121b.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,2);
+	my $f4 = substr($result,4,1);
+	my $f5 = substr($result,5,1);
+	my $f6 = substr($result,6,1);
+	my $f7 = substr($result,7,1);
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							"f2$f2" => 1,
+							f3 => $f3,
+							"f4$f4" => 1,
+							"f5$f5" => 1,
+							"f6$f6" => 1,
+							"f7$f7" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_122.pl
===================================================================
RCS file: unimarc_field_122.pl
diff -N unimarc_field_122.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_122.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,96 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_122.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "122".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_122.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 122\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_122.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,4);
+	my $f3 = substr($result,5,2);
+	my $f4 = substr($result,7,2);
+	my $f5 = substr($result,9,2);
+	$template->param(index => $index,
+							"f1$f1" => 1,
+							f2 => $f2,
+							f3 => $f3,
+							f4 => $f4,
+			 f5 => $f5);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123a.pl
===================================================================
RCS file: unimarc_field_123a.pl
diff -N unimarc_field_123a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123a\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => $f1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123d.pl
===================================================================
RCS file: unimarc_field_123d.pl
diff -N unimarc_field_123d.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123d.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123d.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123g".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123g.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,3);
+	my $f3 = substr($result,4,2);
+	my $f4 = substr($result,6,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 f2 => $f2,
+			 f3 => $f3,
+			 f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123e.pl
===================================================================
RCS file: unimarc_field_123e.pl
diff -N unimarc_field_123e.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123e.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123e.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123g".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123g.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,3);
+	my $f3 = substr($result,4,2);
+	my $f4 = substr($result,6,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 f2 => $f2,
+			 f3 => $f3,
+			 f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123f.pl
===================================================================
RCS file: unimarc_field_123f.pl
diff -N unimarc_field_123f.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123f.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123f.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123g".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123g.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,3);
+	my $f3 = substr($result,4,2);
+	my $f4 = substr($result,6,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 f2 => $f2,
+			 f3 => $f3,
+			 f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123g.pl
===================================================================
RCS file: unimarc_field_123g.pl
diff -N unimarc_field_123g.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123g.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123g.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123g".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123g.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123g.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,3);
+	my $f3 = substr($result,4,2);
+	my $f4 = substr($result,6,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 f2 => $f2,
+			 f3 => $f3,
+			 f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123i.pl
===================================================================
RCS file: unimarc_field_123i.pl
diff -N unimarc_field_123i.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123i.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123i.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123i".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123i.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123i\",'width=800,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123i.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,3);
+	my $f3 = substr($result,4,2);
+	my $f4 = substr($result,6,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 f2 => $f2,
+			 f3 => $f3,
+			 f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_123j.pl
===================================================================
RCS file: unimarc_field_123j.pl
diff -N unimarc_field_123j.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_123j.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123j.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "123j".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_123j.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 123j\",'width=800,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_123j.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,3);
+	my $f3 = substr($result,4,2);
+	my $f4 = substr($result,6,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 f2 => $f2,
+			 f3 => $f3,
+			 f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124.pl
===================================================================
RCS file: unimarc_field_124.pl
diff -N unimarc_field_124.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_100.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=500,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_100.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,8);
+	my $f2 = substr($result,8,1);
+	my $f3 = substr($result,9,4);
+	my $f4 = substr($result,13,4);
+	$template->param(index => $index,
+							f1 => $f1,
+							f3 => $f3,
+							"f2$f2" => 1,
+							f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124a.pl
===================================================================
RCS file: unimarc_field_124a.pl
diff -N unimarc_field_124a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124a\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124b.pl
===================================================================
RCS file: unimarc_field_124b.pl
diff -N unimarc_field_124b.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124b.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124b.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124b".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124b.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124b\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124b.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124c.pl
===================================================================
RCS file: unimarc_field_124c.pl
diff -N unimarc_field_124c.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124c.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124c.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124c".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124c.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124c\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124c.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124d.pl
===================================================================
RCS file: unimarc_field_124d.pl
diff -N unimarc_field_124d.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124d.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124d.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124d".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124d.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124d\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124d.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124e.pl
===================================================================
RCS file: unimarc_field_124e.pl
diff -N unimarc_field_124e.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124e.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124e.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124e".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124e.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124e\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124e.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124f.pl
===================================================================
RCS file: unimarc_field_124f.pl
diff -N unimarc_field_124f.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124f.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124f.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124f".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124f.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124f\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124f.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_124g.pl
===================================================================
RCS file: unimarc_field_124g.pl
diff -N unimarc_field_124g.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_124g.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124g.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "124g".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_124g.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 124g\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_124g.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_125.pl
===================================================================
RCS file: unimarc_field_125.pl
diff -N unimarc_field_125.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_125.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_125.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_100.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=500,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_100.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,8);
+	my $f2 = substr($result,8,1);
+	my $f3 = substr($result,9,4);
+	my $f4 = substr($result,13,4);
+	$template->param(index => $index,
+							f1 => $f1,
+							f3 => $f3,
+							"f2$f2" => 1,
+							f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_125a.pl
===================================================================
RCS file: unimarc_field_125a.pl
diff -N unimarc_field_125a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_125a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,89 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_125a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "125a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_125a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 125a\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_125a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1,"f2$f2" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_125b.pl
===================================================================
RCS file: unimarc_field_125b.pl
diff -N unimarc_field_125b.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_125b.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_125b.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "125b".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_125b.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 125b\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_125b.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_126.pl
===================================================================
RCS file: unimarc_field_126.pl
diff -N unimarc_field_126.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_126.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_126.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_100.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=500,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_100.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,8);
+	my $f2 = substr($result,8,1);
+	my $f3 = substr($result,9,4);
+	my $f4 = substr($result,13,4);
+	$template->param(index => $index,
+							f1 => $f1,
+							f3 => $f3,
+							"f2$f2" => 1,
+							f4 => $f4);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_126a.pl
===================================================================
RCS file: unimarc_field_126a.pl
diff -N unimarc_field_126a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_126a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,117 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_126a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "126a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_126a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 126a\",'width=1000,height=575,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_126a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,1);
+	my $f5 = substr($result,4,1);
+	my $f6 = substr($result,5,1);
+	my $f7 = substr($result,6,1);
+	my $f8 = substr($result,7,1);
+	my $f9 = substr($result,8,1);
+	my $f10 = substr($result,9,1);
+	my $f11 = substr($result,10,1);
+	my $f12 = substr($result,11,1);
+	my $f13 = substr($result,12,1);
+	my $f14 = substr($result,13,1);
+	my $f15 = substr($result,14,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 "f2$f2" => 1,
+			 "f3$f3" => 1,
+			 "f4$f4" => 1,
+			 "f5$f5" => 1,
+			 "f6$f6" => 1,
+			 "f7$f7" => 1,
+			 "f8$f8" => 1,
+			 "f9$f9" => 1,
+			 "f10$f10" => 1,
+			 "f11$f11" => 1,
+			 "f12$f12" => 1,
+			 "f13$f13" => 1,
+			 "f14$f14" => 1,
+			 "f15$f15" => 1
+);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_126b.pl
===================================================================
RCS file: unimarc_field_126b.pl
diff -N unimarc_field_126b.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_126b.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,93 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_126b.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "126b".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_126b.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 126b\",'width=1000,height=575,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_126b.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 "f2$f2" => 1,
+			 "f3$f3" => 1
+);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_127.pl
===================================================================
RCS file: unimarc_field_127.pl
diff -N unimarc_field_127.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_127.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,92 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_127.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "127".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_127.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 127\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_127.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,2);
+	my $f2 = substr($result,2,2);
+	my $f3 = substr($result,4,2);
+	$template->param(index => $index,
+			 "f1" => $f1,
+			 f2 => $f2,
+			 f3 => $f3);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_128a.pl
===================================================================
RCS file: unimarc_field_128a.pl
diff -N unimarc_field_128a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_128a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_128a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "128a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_128a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 128a\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_128a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_128b.pl
===================================================================
RCS file: unimarc_field_128b.pl
diff -N unimarc_field_128b.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_128b.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_128b.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "128b".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_128b.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 128b\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_128b.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_128c.pl
===================================================================
RCS file: unimarc_field_128c.pl
diff -N unimarc_field_128c.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_128c.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_128c.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "128c".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_128c.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 128c\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_128c.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,2);
+	$template->param(index => $index,
+			 "f1$f1" => 1);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_130.pl
===================================================================
RCS file: unimarc_field_130.pl
diff -N unimarc_field_130.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_130.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_130.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "130".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_130.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 130\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_130.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,1);
+	my $f5 = substr($result,4,3);
+	my $f6 = substr($result,7,1);
+	my $f7 = substr($result,8,1);
+	my $f8 = substr($result,9,1);
+	my $f9 = substr($result,10,1);
+
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 "f2$f2" => 1,
+			 "f3$f3" => 1,
+			 "f4$f4" => 1,
+			 "f5" => $f5,
+			 "f6$f6" => 1,
+			 "f7$f7" => 1,
+			 "f8$f8" => 1,
+			 "f9$f9" => 1
+
+);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_135a.pl
===================================================================
RCS file: unimarc_field_135a.pl
diff -N unimarc_field_135a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_135a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_135a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-135a7 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "135a".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_135a.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 135a\",'width=1000,height=375,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_135a.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,1);
+	my $f5 = substr($result,4,3);
+	my $f6 = substr($result,7,1);
+	my $f7 = substr($result,8,1);
+	my $f8 = substr($result,9,1);
+	my $f9 = substr($result,10,1);
+
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 "f2$f2" => 1,
+			 "f3$f3" => 1,
+			 "f4$f4" => 1,
+			 "f5" => $f5,
+			 "f6$f6" => 1,
+			 "f7$f7" => 1,
+			 "f8$f8" => 1,
+			 "f9$f9" => 1
+
+);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_140.pl
===================================================================
RCS file: unimarc_field_140.pl
diff -N unimarc_field_140.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_140.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,132 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_140.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1407 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "140".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_140.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 140\",'width=1000,height=575,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_140.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,1);
+	my $f5 = substr($result,4,1);
+	my $f6 = substr($result,5,1);
+	my $f7 = substr($result,6,1);
+	my $f8 = substr($result,7,1);
+	my $f9 = substr($result,8,1);
+	my $f10 = substr($result,9,2);
+	my $f11 = substr($result,11,2);
+	my $f12 = substr($result,13,2);
+	my $f13 = substr($result,15,2);
+	my $f14 = substr($result,17,2);
+	my $f15 = substr($result,19,1);
+	my $f16 = substr($result,20,1);
+	my $f17 = substr($result,21,1);
+	my $f18 = substr($result,22,1);
+	my $f19 = substr($result,23,1);
+	my $f20 = substr($result,24,1);
+	my $f21 = substr($result,25 ,1);
+
+warn "Dans ce cas clea nous fait un f17 => $f17\n";
+
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 "f2$f2" => 1,
+			 "f3$f3" => 1,
+			 "f4$f4" => 1,
+			 "f5$f5" => 1,
+			 "f6$f6" => 1,
+			 "f7$f7" => 1,
+			 "f8$f8" => 1,
+			 "f9$f9" => 1,
+			 "f10$f10" => 1,
+			 "f11$f11" => 1,
+			 "f12$f12" => 1,
+			 "f13$f13" => 1,
+			 "f14$f14" => 1,
+			 "f15$f15" => 1,
+			 "f16$f16" => 1,
+			 "f17$f17" => 1,
+			 "f18$f18" => 1,
+			 "f19$f19" => 1,
+			 "f20$f20" => 1,
+			 "f21$f21" => 1
+);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_141.pl
===================================================================
RCS file: unimarc_field_141.pl
diff -N unimarc_field_141.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_141.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_141.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1417 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "141".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_141.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 141\",'width=1000,height=575,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_field_141.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	my $f1 = substr($result,0,1);
+	my $f2 = substr($result,1,1);
+	my $f3 = substr($result,2,1);
+	my $f4 = substr($result,3,1);
+	my $f5 = substr($result,4,1);
+	my $f6 = substr($result,5,1);
+	my $f7 = substr($result,6,1);
+	my $f8 = substr($result,7,1);
+
+	$template->param(index => $index,
+			 "f1$f1" => 1,
+			 "f2$f2" => 1,
+			 "f3$f3" => 1,
+			 "f4$f4" => 1,
+			 "f5$f5" => 1,
+			 "f6$f6" => 1,
+			 "f7$f7" => 1,
+			 "f8$f8" => 1
+);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_210c.pl
===================================================================
RCS file: unimarc_field_210c.pl
diff -N unimarc_field_210c.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_210c.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,246 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_210c.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+require Exporter;
+use C4::AuthoritiesMarc;
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use MARC::Record;
+use C4::Koha;
+use HTML::Template;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+=head1
+
+plugin_javascript : the javascript function called when the user enters the subfield.
+contain 3 javascript functions :
+* one called when the field is entered (OnFocus). Named FocusXXX
+* one called when the field is leaved (onBlur). Named BlurXXX
+* one called when the ... link is clicked (<a href="javascript:function">) named ClicXXX
+
+returns :
+* XXX
+* a variable containing the 3 scripts.
+the 3 scripts are inserted after the <input> in the html code
+
+=cut
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "210c".(int(rand(100000))+1);
+#---- build editors list.
+#---- the editor list is built from the "EDITORS" thesaurus
+#---- this thesaurus category must be filled as follow :
+#---- 200$a for isbn
+#---- 200$b for editor
+#---- 200$c (repeated) for collections
+my $sth = $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table 
+						left join auth_header on auth_subfield_table.authid=auth_header.authid 
+						where authtypecode='EDITORS' and tag='200' and subfieldcode='a'");
+my $sth2 = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='b' and authid=?");
+$sth->execute;
+my @editors;
+my $authoritysep = C4::Context->preference("authoritysep");
+while (my ($authid,$isbn) = $sth->fetchrow) {
+	$sth2->execute($authid);
+	my ($editor) = $sth2->fetchrow;
+	push(@editors,"$isbn $authoritysep $editor");
+}
+my $res  = "
+<script>
+function Focus$function_name(index) {
+var isbn_array = [ ";
+foreach my $editor (@editors) {
+	my @arr = split (/ $authoritysep /,$editor);
+	$res .='["'.$arr[0].'","'.$arr[1].'","'.$arr[2].'"],';
+}
+chop $res;
+$res .= "
+];
+	// search isbn subfield. it''s 010a
+	var isbn_found;
+	for (i=0 ; i<document.f.field_value.length ; i++) {
+		if (document.f.tag[i].value == '010' && document.f.subfield[i].value == 'a') {
+			isbn_found=document.f.field_value[i].value;
+		}
+	}
+	for (i=0;i<=isbn_array.length;i++) {
+		if (isbn_found.substr(0,isbn_array[i][0].length) == isbn_array[i][0]) {
+			document.f.field_value[index].value =isbn_array[i][1];
+		}
+	}
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(subfield_managed) {
+	defaultvalue=escape(document.forms[0].field_value[subfield_managed].value);
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_210c.pl&index=\"+subfield_managed,\"unimarc 225a\",'width=500,height=600,toolbar=false,scrollbars=yes');
+}
+</script>
+";
+return ($function_name,$res);
+}
+
+=head1
+
+plugin : the true value_builded. The screen that is open in the popup window.
+
+=cut
+
+sub plugin {
+my ($input) = @_;
+	my $index = $input->param("index");
+	my $result =  $input->param("result");
+
+	my $query=new CGI;
+	my $op = $query->param('op');
+	my $authtypecode = $query->param('authtypecode');
+	my $index = $query->param('index');
+	my $category = $query->param('category');
+	my $resultstring = $query->param('result');
+	my $dbh = C4::Context->dbh;
+	
+	my $startfrom=$query->param('startfrom');
+	$startfrom=0 if(!defined $startfrom);
+	my ($template, $loggedinuser, $cookie);
+	my $resultsperpage;
+	
+	my $authtypes = getauthtypes;
+	my @authtypesloop;
+	foreach my $thisauthtype (keys %$authtypes) {
+		my $selected = 1 if $thisauthtype eq $authtypecode;
+		my %row =(value => $thisauthtype,
+					selected => $selected,
+					authtypetext => $authtypes->{$thisauthtype}{'authtypetext'},
+				index => $index,
+				);
+		push @authtypesloop, \%row;
+	}
+
+	if ($op eq "do_search") {
+		my @marclist = $query->param('marclist');
+		my @and_or = $query->param('and_or');
+		my @excluding = $query->param('excluding');
+		my @operator = $query->param('operator');
+		my @value = $query->param('value');
+	
+		$resultsperpage= $query->param('resultsperpage');
+		$resultsperpage = 19 if(!defined $resultsperpage);
+	
+		# builds tag and subfield arrays
+		my @tags;
+	
+		my ($results,$total) = authoritysearch($dbh, \@tags,\@and_or,
+											\@excluding, \@operator, \@value,
+											$startfrom*$resultsperpage, $resultsperpage,$authtypecode);# $orderby);
+	
+		($template, $loggedinuser, $cookie)
+			= get_template_and_user({template_name => "value_builder/unimarc_field_210c.tmpl",
+					query => $query,
+					type => 'intranet',
+					authnotrequired => 0,
+					flagsrequired => {editcatalogue => 1},
+					debug => 1,
+					});
+	
+		# multi page display gestion
+		my $displaynext=0;
+		my $displayprev=$startfrom;
+		if(($total - (($startfrom+1)*($resultsperpage))) > 0 ) {
+			$displaynext = 1;
+		}
+	
+		my @numbers = ();
+	
+		if ($total>$resultsperpage) {
+			for (my $i=1; $i<$total/$resultsperpage+1; $i++) {
+				if ($i<16) {
+					my $highlight=0;
+					($startfrom==($i-1)) && ($highlight=1);
+					push @numbers, { number => $i,
+						highlight => $highlight ,
+						startfrom => ($i-1)};
+				}
+			}
+		}
+	
+		my $from = $startfrom*$resultsperpage+1;
+		my $to;
+	
+		if($total < (($startfrom+1)*$resultsperpage)) {
+			$to = $total;
+		} else {
+			$to = (($startfrom+1)*$resultsperpage);
+		}
+		$template->param(result => $results) if $results;
+		$template->param(index => $query->param('index'));
+		$template->param(startfrom=> $startfrom,
+								displaynext=> $displaynext,
+								displayprev=> $displayprev,
+								resultsperpage => $resultsperpage,
+								startfromnext => $startfrom+1,
+								startfromprev => $startfrom-1,
+								index => $index,
+								total=>$total,
+								from=>$from,
+								to=>$to,
+								numbers=>\@numbers,
+								authtypecode =>$authtypecode,
+								resultstring =>$value[0],
+								);
+	} else {
+		($template, $loggedinuser, $cookie)
+			= get_template_and_user({template_name => "value_builder/unimarc_field_210c.tmpl",
+					query => $query,
+					type => 'intranet',
+					authnotrequired => 0,
+					flagsrequired => {catalogue => 1},
+					debug => 1,
+					});
+	
+		$template->param(index => $index,
+						resultstring => $resultstring
+						);
+	}
+	
+	$template->param(authtypesloop => \@authtypesloop);
+	$template->param(category => $category);
+	
+	# Print the page
+	output_html_with_http_headers $query, $cookie, $template->output;
+}
+
+1;

Index: unimarc_field_225a.pl
===================================================================
RCS file: unimarc_field_225a.pl
diff -N unimarc_field_225a.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_225a.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,161 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_225a.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+=head1 SYNOPSIS
+
+This plugin is used to map isbn/editor with collection.
+It need :
+  in thesaurus, a category named EDITORS
+  in this category, datas must be entered like following :
+  isbn separator editor separator collection.
+  for example :
+  2204 -- Cerf -- Cogitatio fidei
+  2204 -- Cerf -- Le Magistère de l'Eglise
+  2204 -- Cerf -- Lectio divina
+  2204 -- Cerf -- Lire la Bible
+  2204 -- Cerf -- Pour lire
+  2204 -- Cerf -- Sources chrétiennes
+
+  when the user clic on ... on 225a line, the popup shows the list of collections from the selected editor
+  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;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(index) {
+// find the 010a value and the 210c. it will be used in the popup to find possibles collections
+	var isbn_found;
+	for (i=0 ; i<document.f.field_value.length ; i++) {
+		if (document.f.tag[i].value == '010' && document.f.subfield[i].value == 'a') {
+			isbn_found=document.f.field_value[i].value;
+		}
+	}
+	var editor_found;
+	for (i=0 ; i<document.f.field_value.length ; i++) {
+		if (document.f.tag[i].value == '210' && document.f.subfield[i].value == 'c') {
+			editor_found=document.f.field_value[i].value;
+		}
+	}
+
+	defaultvalue=document.f.field_value[index].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_225a.pl&index=\"+index+\"&result=\"+defaultvalue+\"&isbn_found=\"+isbn_found+\"&editor_found=\"+editor_found,\"unimarc 225a\",'width=500,height=200,toolbar=false,scrollbars=no');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new CGI;
+	my $index= $input->param('index');
+	my $result= $input->param('result');
+	my $editor_found = $input->param('editor_found');
+	my $isbn_found = $input->param('isbn_found');
+	my $dbh = C4::Context->dbh;
+	my $authoritysep = C4::Context->preference("authoritysep");
+	my ($template, $loggedinuser, $cookie)
+	= get_template_and_user({template_name => "value_builder/unimarc_field_225a.tmpl",
+					query => $input,
+					type => "intranet",
+					authnotrequired => 0,
+					flagsrequired => {editcatalogue => 1},
+					debug => 1,
+					});
+# builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
+	# if there is an isbn, complete search
+		my @collections;
+		if ($isbn_found) {
+			my $sth = $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table 
+							left join auth_header on auth_subfield_table.authid=auth_header.authid 
+							where authtypecode='EDITORS' and tag='200' and subfieldcode='a' and subfieldvalue=?");
+			my $sth2 = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='c' and authid=? order by subfieldvalue");
+			my @splited = split //, $isbn_found;
+			my $isbn_rebuild='';
+			foreach my $x (@splited) {
+				$isbn_rebuild.=$x;
+				$sth->execute($isbn_rebuild);
+				my ($authid) = $sth->fetchrow;
+				$sth2->execute($authid);
+				while (my ($line)= $sth2->fetchrow) {
+					push @collections,$line;
+				}
+			}
+		} else {
+			my $sth = $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table 
+							left join auth_header on auth_subfield_table.authid=auth_header.authid 
+							where authtypecode='EDITORS' and tag='200' and subfieldcode='b' and subfieldvalue=?");
+			my $sth2 = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='c' and authid=? order by subfieldvalue");
+			$sth->execute($editor_found);
+			my ($authid) = $sth->fetchrow;
+			$sth2->execute($authid);
+			while (my ($line)= $sth2->fetchrow) {
+				push @collections,$line;
+			}
+		}
+#	my @collections = ["test"];
+	my $collection =CGI::scrolling_list(-name=>'f1',
+												-values=> \@collections,
+												-default=>"$result",
+												-size=>1,
+												-multiple=>0,
+												);
+	$template->param(index => $index,
+							collection => $collection);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_4XX.pl
===================================================================
RCS file: unimarc_field_4XX.pl
diff -N unimarc_field_4XX.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_4XX.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,403 @@
+#!/usr/bin/perl
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+require Exporter;
+use CGI;
+use HTML::Template;
+use C4::Interface::CGI::Output;
+use C4::Context;
+use C4::Search;
+use C4::Auth;
+use C4::Output;
+use C4::Database;
+use C4::Biblio;
+use C4::Acquisition;
+use C4::Koha;
+use MARC::Record;
+
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "4XX".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.f.field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_4XX.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 4\"+i+\"\",'width=700,height=700,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+
+sub plugin {
+	my ($input) = @_;
+	my %env;
+	
+	
+	my $dbh=C4::Context->dbh;
+	my $query = new CGI;
+	my $op = $query->param('op');
+	my $type=$query->param('type');
+	warn "operation  ".$op;
+	my $startfrom=$query->param('startfrom');
+	$startfrom=0 if(!defined $startfrom);
+	my ($template, $loggedinuser, $cookie);
+	my $resultsperpage;
+	my $searchdesc;
+	
+	if ($op eq "fillinput"){
+		my $bibnum = $query->param('bibnum');
+		my $index = $query->param('index');
+		my $marcrecord;
+# open template
+		($template, $loggedinuser, $cookie)= get_template_and_user({template_name => "value_builder/unimarc_field_4XX.tmpl",
+			     query => $query,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			    });
+		#get bibid
+		my $bibid;
+		my $req= $dbh->prepare("SELECT distinctrow bibid,biblionumber FROM `marc_biblio` WHERE biblionumber= ?");
+		$req->execute($bibnum);
+		($bibid,$bibnum) = $req->fetchrow;
+		#warn "bibid :".$bibid;
+		#get marc record
+		$marcrecord = MARCgetbiblio($dbh,$bibid);
+# 		warn "record : ".$marcrecord->as_formatted;
+		
+		my $subfield_value_9=$bibid;
+		my $subfield_value_0;
+		$subfield_value_0=$marcrecord->field('001')->data if $marcrecord->field('001');
+		my $subfield_value_a;
+		if ($marcrecord->field('700')){
+			$subfield_value_a=$marcrecord->field('700')->subfield("a");
+			$subfield_value_a.=", ".$marcrecord->field('700')->subfield("b") if ($marcrecord->field('700')->subfield("b"));
+			$subfield_value_a.=" ".$marcrecord->field('700')->subfield("d") if ($marcrecord->field('700')->subfield("d"));
+			$subfield_value_a.=" (".$marcrecord->field('700')->subfield("c")." - " if ($marcrecord->field('700')->subfield("c"));
+			$subfield_value_a.=" (" if (($marcrecord->field('700')->subfield("f")) and not( $marcrecord->field('700')->subfield("c")));
+			$subfield_value_a.=$marcrecord->field('700')->subfield("f") if ($marcrecord->field('700')->subfield("f"));
+			$subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c"));
+		} elsif ($marcrecord->field('702')){
+			$subfield_value_a=$marcrecord->field('702')->subfield("a");
+			$subfield_value_a.=", ".$marcrecord->field('702')->subfield("b") if ($marcrecord->field('702')->subfield("b"));
+			$subfield_value_a.=" ".$marcrecord->field('702')->subfield("d") if ($marcrecord->field('702')->subfield("d"));
+			$subfield_value_a.=" (".$marcrecord->field('702')->subfield("c")."; " if ($marcrecord->field('702')->subfield("c"));
+			$subfield_value_a.=" (" if (($marcrecord->field('702')->subfield("f")) and not($marcrecord->field('702')->subfield("c")) );
+			$subfield_value_a.=$marcrecord->field('702')->subfield("f") if ($marcrecord->field('702')->subfield("f"));
+			$subfield_value_a.=")" if ($marcrecord->field('702')->subfield("f")) or ($marcrecord->field('702')->subfield("c"));
+		} elsif ($marcrecord->field('710')){
+			$subfield_value_a=$marcrecord->field('710')->subfield("d")."° " if ($marcrecord->field('710')->subfield("d"));
+			$subfield_value_a.=$marcrecord->field('710')->subfield("a") if ($marcrecord->field('710')->subfield("a"));
+			$subfield_value_a.=", ".$marcrecord->field('710')->subfield("b") if ($marcrecord->field('710')->subfield("b"));
+			$subfield_value_a.=" (".$marcrecord->field('710')->subfield("f")." - " if ($marcrecord->field('710')->subfield("f"));
+			$subfield_value_a.=" (" if (($marcrecord->field('710')->subfield("e")) and not( $marcrecord->field('710')->subfield("f")));
+			$subfield_value_a.=$marcrecord->field('710')->subfield("e") if ($marcrecord->field('710')->subfield("e"));
+			$subfield_value_a.=")" if (($marcrecord->field('710')->subfield("e")) or ($marcrecord->field('710')->subfield("f")));
+		} elsif ($marcrecord->field('701')){
+			$subfield_value_a=$marcrecord->field('701')->subfield("a");
+			$subfield_value_a.=", ".$marcrecord->field('701')->subfield("b") if ($marcrecord->field('701')->subfield("b"));
+			$subfield_value_a.=" ".$marcrecord->field('701')->subfield("d") if ($marcrecord->field('701')->subfield("d"));
+			$subfield_value_a.=" (".$marcrecord->field('701')->subfield("c")." - " if ($marcrecord->field('701')->subfield("c"));
+			$subfield_value_a.=" (" if (($marcrecord->field('701')->subfield("f")) and not( $marcrecord->field('701')->subfield("c")));
+			$subfield_value_a.=$marcrecord->field('701')->subfield("f") if ($marcrecord->field('701')->subfield("f"));
+			$subfield_value_a.=")" if ($marcrecord->field('701')->subfield("f")) or ($marcrecord->field('701')->subfield("c"));
+		} elsif ($marcrecord->field('712')){
+			$subfield_value_a=$marcrecord->field('712')->subfield("d")."° " if ($marcrecord->field('712')->subfield("d"));
+			$subfield_value_a.=$marcrecord->field('712')->subfield("a") if ($marcrecord->field('712')->subfield("a"));
+			$subfield_value_a.=", ".$marcrecord->field('712')->subfield("b") if ($marcrecord->field('712')->subfield("b"));
+			$subfield_value_a.=" (".$marcrecord->field('712')->subfield("f")." - " if ($marcrecord->field('712')->subfield("f"));
+			$subfield_value_a.=" (" if (($marcrecord->field('712')->subfield("e")) and not( $marcrecord->field('712')->subfield("f")));
+			$subfield_value_a.=$marcrecord->field('712')->subfield("e") if ($marcrecord->field('712')->subfield("e"));
+			$subfield_value_a.=")" if (($marcrecord->field('712')->subfield("e")) or ($marcrecord->field('712')->subfield("f")));
+		} elsif ($marcrecord->field('200')){
+			$subfield_value_a=$marcrecord->field('200')->subfield("f");
+		} 
+		my $subfield_value_c = $marcrecord->field('210')->subfield("a") if ($marcrecord->field('210'));
+		my $subfield_value_d = $marcrecord->field('210')->subfield("d") if ($marcrecord->field('210'));
+		
+		my $subfield_value_e= $marcrecord->field('205')->subfield("a") if ($marcrecord->field('205'));
+		
+		my $subfield_value_h; 
+		if (($marcrecord->field('200')) && ($marcrecord->field('200')->subfield("h"))){
+			$subfield_value_h = $marcrecord->field('200')->subfield("h") ;
+		} elsif (($marcrecord->field('225')) && ($marcrecord->field('225')->subfield("h"))) {
+			$subfield_value_h = $marcrecord->field('225')->subfield("h") ;
+		} elsif (($marcrecord->field('500')) && ($marcrecord->field('500')->subfield("h"))) {
+			$subfield_value_h = $marcrecord->field('500')->subfield("h") ;
+		}
+		
+		my $subfield_value_i;
+		if (($marcrecord->field('200')) && ($marcrecord->field('200')->subfield("i"))){
+			$subfield_value_i = $marcrecord->field('200')->subfield("i") ;
+		} elsif (($marcrecord->field('225')) && ($marcrecord->field('225')->subfield("i"))) {
+			$subfield_value_i = $marcrecord->field('225')->subfield("i") ;
+		} elsif (($marcrecord->field('500')) && ($marcrecord->field('500')->subfield("i"))) {
+			$subfield_value_i = $marcrecord->field('500')->subfield("i") ;
+		}
+
+		my $subfield_value_p = $marcrecord->field('215')->subfield("a") if ($marcrecord->field('215'));
+		
+		my $subfield_value_t;
+		if (($marcrecord->field('200')) && ($marcrecord->field('200')->subfield("a"))){
+			$subfield_value_t = $marcrecord->field('200')->subfield("a") ;
+		} elsif (($marcrecord->field('225')) && ($marcrecord->field('225')->subfield("a"))) {
+			$subfield_value_t = $marcrecord->field('225')->subfield("a") ;
+		} elsif (($marcrecord->field('500')) && ($marcrecord->field('500')->subfield("a"))) {
+			$subfield_value_t = $marcrecord->field('500')->subfield("a") ;
+		}
+		
+		my $subfield_value_u = $marcrecord->field('856')->subfield("u") if ($marcrecord->field('856'));
+		
+		my $subfield_value_v;
+		if (($marcrecord->field('225')) && ($marcrecord->field('225')->subfield("v"))){
+			$subfield_value_v = $marcrecord->field('225')->subfield("v") ;
+		} elsif (($marcrecord->field('200')) && ($marcrecord->field('200')->subfield("h"))) {
+			$subfield_value_v = $marcrecord->field('200')->subfield("h") ;
+		}
+		my $subfield_value_x = $marcrecord->field('011')->subfield("a") if ($marcrecord->field('011') and not (($marcrecord->field('011')->subfield("y")) or ($marcrecord->field('011')->subfield("z"))));
+		my $subfield_value_y = $marcrecord->field('013')->subfield("a") if ($marcrecord->field('013'));
+		if ($marcrecord->field('010')){
+			$subfield_value_y = $marcrecord->field('010')->subfield("a");
+		}
+		$template->param(fillinput => 1,
+						index => $query->param('index')."",
+						bibid=>$bibid?$bibid:"",
+						subfield_value_9=>$subfield_value_9,
+						subfield_value_0=>$subfield_value_0,
+						subfield_value_a=>$subfield_value_a,
+						subfield_value_c=>$subfield_value_c,
+						subfield_value_d=>$subfield_value_d,
+						subfield_value_e=>$subfield_value_e,
+						subfield_value_h=>$subfield_value_h,
+						subfield_value_i=>$subfield_value_i,
+						subfield_value_p=>$subfield_value_p,
+						subfield_value_t=>$subfield_value_t,
+						subfield_value_u=>$subfield_value_u,
+						subfield_value_v=>$subfield_value_v,
+						subfield_value_x=>$subfield_value_x,
+						subfield_value_y=>$subfield_value_y,
+						);
+###############################################################	
+	}elsif ($op eq "do_search") {
+		my @marclist = $query->param('marclist');
+		my @and_or = $query->param('and_or');
+		my @excluding = $query->param('excluding');
+		my @operator = $query->param('operator');
+		my @value = $query->param('value');
+	
+		for (my $i=0;$i<=$#marclist;$i++) {
+			if ($searchdesc) { # don't put the and_or on the 1st search term
+				$searchdesc .= $and_or[$i]." ".$excluding[$i]." ".($marclist[$i]?$marclist[$i]:"*")." ".$operator[$i]." ".$value[$i]." " if ($value[$i]);
+			} else {
+				$searchdesc = $excluding[$i]." ".($marclist[$i]?$marclist[$i]:"*")." ".$operator[$i]." ".$value[$i]." " if ($value[$i]);
+			}
+		}
+		$resultsperpage= $query->param('resultsperpage');
+		$resultsperpage = 19 if(!defined $resultsperpage);
+		my $orderby = $query->param('orderby');
+		my $desc_or_asc = $query->param('desc_or_asc');
+	
+		# builds tag and subfield arrays
+		my @tags;
+		foreach my $marc (@marclist) {
+			if ($marc) {
+				my ($tag,$subfield) = MARCfind_marc_from_kohafield($dbh,$marc,'');
+				if ($tag) {
+					push @tags,$dbh->quote("$tag$subfield");
+				} else {
+					push @tags, $dbh->quote(substr($marc,0,4));
+				}
+			} else {
+				push @tags, "";
+			}
+		}
+		
+		my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or,
+											\@excluding, \@operator, \@value,
+											$startfrom*$resultsperpage, $resultsperpage,$orderby, $desc_or_asc);
+#		warn " biblio count : ".$total;
+		
+		($template, $loggedinuser, $cookie)
+			= get_template_and_user({template_name => "value_builder/unimarc_field_4XX.tmpl",
+					query => $query,
+					type => 'intranet',
+					authnotrequired => 1,
+					debug => 1,
+					});
+	
+		# multi page display gestion
+		my $displaynext=0;
+		my $displayprev=$startfrom;
+		if(($total - (($startfrom+1)*($resultsperpage))) > 0 ){
+			$displaynext = 1;
+		}
+	
+		my @field_data = ();
+	
+	
+		for(my $i = 0 ; $i <= $#marclist ; $i++)
+		{
+			push @field_data, { term => "marclist", val=>$marclist[$i] };
+			push @field_data, { term => "and_or", val=>$and_or[$i] };
+			push @field_data, { term => "excluding", val=>$excluding[$i] };
+			push @field_data, { term => "operator", val=>$operator[$i] };
+			push @field_data, { term => "value", val=>$value[$i] };
+		}
+	
+		my @numbers = ();
+	
+		if ($total>$resultsperpage)
+		{
+			for (my $i=1; $i<$total/$resultsperpage+1; $i++)
+			{
+				if ($i<16)
+				{
+					my $highlight=0;
+					($startfrom==($i-1)) && ($highlight=1);
+					push @numbers, { number => $i,
+						highlight => $highlight ,
+						searchdata=> \@field_data,
+						startfrom => ($i-1)};
+				}
+			}
+		}
+	
+		my $from = $startfrom*$resultsperpage+1;
+		my $to;
+	
+		if($total < (($startfrom+1)*$resultsperpage))
+		{
+			$to = $total;
+		} else {
+			$to = (($startfrom+1)*$resultsperpage);
+		}
+		my $defaultview = 'BiblioDefaultView'.C4::Context->preference('BiblioDefaultView');
+		$template->param(result => $results,
+						index => $query->param('index')."",
+								startfrom=> $startfrom,
+								displaynext=> $displaynext,
+								displayprev=> $displayprev,
+								resultsperpage => $resultsperpage,
+								orderby => $orderby,
+								startfromnext => $startfrom+1,
+								startfromprev => $startfrom-1,
+								searchdata=>\@field_data,
+								total=>$total,
+								from=>$from,
+								to=>$to,
+								numbers=>\@numbers,
+								searchdesc=> $searchdesc,
+								$defaultview => 1,
+								Search =>0
+								);
+	
+	} else {
+		($template, $loggedinuser, $cookie)
+			= get_template_and_user({template_name => "value_builder/unimarc_field_4XX.tmpl",
+						query => $query,
+						type => "intranet",
+						authnotrequired => 1,
+					});
+		
+		
+		my $sth=$dbh->prepare("Select itemtype,description from itemtypes order by description");
+		$sth->execute;
+		my  @itemtype;
+		my %itemtypes;
+		push @itemtype, "";
+		$itemtypes{''} = "";
+		while (my ($value,$lib) = $sth->fetchrow_array) {
+			push @itemtype, $value;
+			$itemtypes{$value}=$lib;
+		}
+		
+		my $CGIitemtype=CGI::scrolling_list( -name     => 'value',
+					-values   => \@itemtype,
+					-labels   => \%itemtypes,
+					-size     => 1,
+					-multiple => 0 );
+		$sth->finish;
+		
+		my @branchloop;
+		my @select_branch;
+		my %select_branches;
+		my $branches=getbranches;
+		push @select_branch, "";
+		$select_branches{''} = "";
+		foreach my $thisbranch (keys %$branches){
+			push @select_branch, $branches->{$thisbranch}->{'branchcode'};
+			$select_branches{$branches->{$thisbranch}->{'branchcode'}} = $branches->{$thisbranch}->{'branchname'};
+		}
+		my $CGIbranch=CGI::scrolling_list( -name     => 'value',
+					-values   => \@select_branch,
+					-labels   => \%select_branches,
+					-size     => 1,
+					-multiple => 0 );
+		$sth->finish;
+		
+		my $req = $dbh->prepare("select distinctrow left(publishercode,45) from biblioitems order by publishercode");
+		$req->execute;
+		my @select;
+		push @select,"";
+		while (my ($value) =$req->fetchrow) {
+			push @select, $value;
+		}
+		my $CGIpublisher=CGI::scrolling_list( -name     => 'value',
+					-id => 'publisher',
+					-values   => \@select,
+					-size     => 1,
+					-multiple => 0 );
+		
+# 		my $sth=$dbh->prepare("select description,itemtype from itemtypes order by description");
+# 		$sth->execute;
+# 		while (my ($description,$itemtype) = $sth->fetchrow) {
+# 			$classlist.="<option value=\"$itemtype\">$description</option>\n";
+# 		}
+# 		$sth->finish;
+				
+		$template->param(#classlist => $classlist,
+						CGIitemtype => $CGIitemtype,
+						CGIbranch => $CGIbranch,
+						CGIPublisher => $CGIpublisher,
+						index=>$query->param('index'),
+						Search =>1,
+		);
+	}	
+	output_html_with_http_headers $query, $cookie, $template->output ;
+}
+
+1;

Index: unimarc_field_60X.pl
===================================================================
RCS file: unimarc_field_60X.pl
diff -N unimarc_field_60X.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_60X.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,118 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_60X.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+use C4::Authorities;
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(index) {
+	defaultvalue=document.f.field_value[index].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_60X.pl&index=\"+index+\"&result=\"+defaultvalue,\"unimarc 700\",'width=700,height=300,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+	my ($input) = @_;
+	my %env;
+	my $dbh = C4::Context->dbh;
+	my $index= $input->param('index');
+	my $result= $input->param('result');
+	my $search_string= $input->param('search_string');
+	my $op = $input->param('op');
+	my $id = $input->param('id');
+	my $insert = $input->param('insert');
+	my %stdlib;
+	my $select_list;
+	if ($op eq "add") {
+		newauthority($dbh,'NC',$insert,$insert,'',1,'');
+		$search_string=$insert;
+	}
+	if ($op eq "select") {
+		my $sti = $dbh->prepare("select stdlib from bibliothesaurus where id=?");
+		$sti->execute($id);
+		my ($freelib_text) = $sti->fetchrow_array;
+		$result = $freelib_text;
+	}
+	my $Rsearch_string="$search_string%";
+	my $authoritysep = C4::Context->preference('authoritysep');
+	my @splitted = /$authoritysep/,$search_string;
+	my $level = $#splitted+1;
+	my $sti;
+	if ($search_string) { # if no search pattern, returns only the 50 1st top level values
+		$sti=$dbh->prepare("select distinct freelib,father,level from bibliothesaurus where category='NC' and freelib like ? order by father,freelib");
+	} else {
+		$sti=$dbh->prepare("select distinct freelib,father,level from bibliothesaurus where category='NC' and level=0 and freelib like ? order by father,freelib limit 0,50");
+	}
+	$sti->execute($Rsearch_string);
+	my @results;
+	while (my ($freelib,$father,$level)=$sti->fetchrow) {
+		my %line;
+		if ($father) {
+			$line{value} = "$father $freelib";
+		} else {
+			$line{value} = "$freelib";
+		}
+		$line{level} = $level+1;
+		$line{father} = $father;
+		push @results, \%line;
+	}
+	my @DeeperResults = SearchDeeper('NC',$search_string);
+	my ($template, $loggedinuser, $cookie)
+	= get_template_and_user({template_name => "value_builder/unimarc_field_60X.tmpl",
+					query => $input,
+					type => "intranet",
+					authnotrequired => 0,
+					flagsrequired => {editcatalogue => 1},
+					debug => 1,
+					});
+# builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
+	$template->param(index => $index,
+							result =>$result,
+							search_string => $search_string?$search_string:$result,
+							results => \@results,
+							deeper => \@DeeperResults,
+				);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_700-4.pl
===================================================================
RCS file: unimarc_field_700-4.pl
diff -N unimarc_field_700-4.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_700-4.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,98 @@
+#!/usr/bin/perl
+
+# written 10/5/2002 by Paul
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1 NAME
+
+plugin unimarc_field_700-4
+
+=head1 SYNOPSIS
+
+This plug-in deals with unimarc field 700-4 (
+
+=head1 DESCRIPTION
+
+=head1 FUNCTIONS
+
+=over 2
+
+=cut
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "7004".(int(rand(100000))+1);
+my $res  = "
+<script>
+function Focus$function_name(index) {
+	return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(subfield_managed) {
+	defaultvalue=document.forms[0].field_value[1].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_700-4.pl&result=\"+defaultvalue+\"&index=$field_number\",\"value builder\",'width=500,height=400,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new CGI;
+	my $index= $input->param('index');
+	my $index2= $input->param('index2');
+	$index2=-1 unless($index2);
+	my $result= $input->param('result');
+
+
+	my $dbh = C4::Context->dbh;
+
+	my ($template, $loggedinuser, $cookie)
+	= get_template_and_user({template_name => "value_builder/unimarc_field_700-4.tmpl",
+					query => $input,
+					type => "intranet",
+					authnotrequired => 0,
+					flagsrequired => {parameters => 1},
+					debug => 1,
+					});
+	$template->param(index => $index,
+							index2 => $index2,
+							"f1_$result" => "f1_".$result,
+							);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_field_700_701_702.pl
===================================================================
RCS file: unimarc_field_700_701_702.pl
diff -N unimarc_field_700_701_702.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_field_700_701_702.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,158 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_700_701_702.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+use C4::Authorities;
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(index) {
+	defaultvalue=document.f.field_value[index].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_field_700_701_702.pl&index=\"+index+\"&result=\"+defaultvalue,\"unimarc 700\",'width=700,height=300,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+	my ($input) = @_;
+	my %env;
+	my $dbh = C4::Context->dbh;
+#	my $input = new CGI;
+	my $index= $input->param('index');
+	my $result= $input->param('result');
+	my $search_string= $input->param('search_string');
+	my $op = $input->param('op');
+	my $id = $input->param('id');
+	my $insert = $input->param('insert');
+	my @freelib;
+	my %stdlib;
+	my $select_list;
+	my ($a,$b,$c,$f) ; # the 4 managed subfields.
+	if ($op eq "add") {
+		newauthority($dbh,'NP',$insert,$insert,'',1,'');
+		$search_string=$insert;
+	}
+	if ($op eq "select") {
+		my $sti = $dbh->prepare("select stdlib from bibliothesaurus where id=?");
+		$sti->execute($id);
+		my ($freelib_text) = $sti->fetchrow_array;
+		$result = $freelib_text;
+		# fill the 4 managed subfields
+		my @arr = split //,$result;
+		my $where = 1;
+		foreach my $x (@arr) {
+			next if ($x eq ')');
+			if ($x eq ',') {
+				$where=2;
+				next;
+			}
+			if ($x eq '(') {
+				if ($result =~ /.*;.*/) {
+					$where=3;
+				} else {
+					$where=4;
+				}
+				next;
+			}
+			if ($x eq ';') {
+				$where=4;
+				next;
+			}
+			if ($where eq 1) {
+				$a.=$x;
+			}
+			if ($where eq 2) {
+				$b.=$x;
+			}
+			if ($where eq 3) {
+				$c.=$x;
+			}
+			if ($where eq 4) {
+				$f.=$x;
+			}
+		}
+# remove trailing blanks
+		$a=~ s/^\s+//g;
+		$b=~ s/^\s+//g;
+		$c=~ s/^\s+//g;
+		$f=~ s/^\s+//g;
+		$a=~ s/\s+$//g;
+		$b=~ s/\s+$//g;
+		$c=~ s/\s+$//g;
+		$f=~ s/^s+$//g;
+	}
+	if ($search_string) {
+	#	my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where freelib like '".$search_string."%' and category ='$category'");
+		my $sti=$dbh->prepare("select id,freelib from bibliothesaurus where match (category,freelib) AGAINST (?) and category ='NP'");
+		$sti->execute($search_string);
+		while (my $line=$sti->fetchrow_hashref) {
+			$stdlib{$line->{'id'}} = "$line->{'freelib'}";
+			push(@freelib,$line->{'id'});
+		}
+		$select_list= CGI::scrolling_list( -name=>'id',
+				-values=> \@freelib,
+				-default=> "",
+				-size=>1,
+				-multiple=>0,
+				-labels=> \%stdlib
+				);
+	}
+	my ($template, $loggedinuser, $cookie)
+	= get_template_and_user({template_name => "value_builder/unimarc_field_700_701_702.tmpl",
+					query => $input,
+					type => "intranet",
+					authnotrequired => 0,
+					flagsrequired => {parameters => 1},
+					debug => 1,
+					});
+# builds collection list : search isbn and editor, in parent, then load collections from bibliothesaurus table
+	$template->param(index => $index,
+							result =>$result,
+							select_list => $select_list,
+							search_string => $search_string?$search_string:$result,
+							a => $a,
+							b => $b,
+							c => $c,
+							f => $f,);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: unimarc_leader.pl
===================================================================
RCS file: unimarc_leader.pl
diff -N unimarc_leader.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ unimarc_leader.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,105 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_leader.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+use strict;
+use C4::Auth;
+use CGI;
+use C4::Context;
+use HTML::Template;
+use C4::Search;
+use C4::Output;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "100".(int(rand(100000))+1);
+my $res="
+<script>
+function Focus$function_name(subfield_managed) {
+return 1;
+}
+
+function Blur$function_name(subfield_managed) {
+	return 1;
+}
+
+function Clic$function_name(i) {
+	defaultvalue=document.forms[0].field_value[i].value;
+	newin=window.open(\"../plugin_launcher.pl?plugin_name=unimarc_leader.pl&index=\"+i+\"&result=\"+defaultvalue,\"unimarc field 100\",'width=1000,height=600,toolbar=false,scrollbars=yes');
+
+}
+</script>
+";
+
+return ($function_name,$res);
+}
+sub plugin {
+my ($input) = @_;
+	my %env;
+
+#	my $input = new 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 => "value_builder/unimarc_leader.tmpl",
+			     query => $input,
+			     type => "intranet",
+			     authnotrequired => 0,
+			     flagsrequired => {editcatalogue => 1},
+			     debug => 1,
+			     });
+	$result = "     nam         3       " 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,
+					);
+	print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: usmarc_field_952v.pl
===================================================================
RCS file: usmarc_field_952v.pl
diff -N usmarc_field_952v.pl
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ usmarc_field_952v.pl	12 Sep 2006 15:50:06 -0000	1.1.2.1
@@ -0,0 +1,101 @@
+#!/usr/bin/perl
+
+# $Id: usmarc_field_952v.pl,v 1.1.2.1 2006/09/12 15:50:06 toins Exp $
+
+# 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 2 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, write to the Free Software Foundation, Inc., 59 Temple Place,
+# Suite 330, Boston, MA  02111-1307 USA
+
+require Exporter;
+use C4::AuthoritiesMarc;
+use C4::Auth;
+use C4::Context;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use CGI;
+use C4::Search;
+use MARC::Record;
+use C4::Koha;
+use HTML::Template;
+
+=head1
+
+plugin_parameters : other parameters added when the plugin is called by the dopop function
+
+=cut
+sub plugin_parameters {
+my ($dbh,$record,$tagslib,$i,$tabloop) = @_;
+return "";
+}
+
+=head1
+
+plugin_javascript : the javascript function called when the user enters the subfield.
+contain 3 javascript functions :
+* one called when the field is entered (OnFocus). Named FocusXXX
+* one called when the field is leaved (onBlur). Named BlurXXX
+* one called when the ... link is clicked (<a href="javascript:function">) named ClicXXX
+
+returns :
+* XXX
+* a variable containing the 3 scripts.
+the 3 scripts are inserted after the <input> in the html code
+
+=cut
+sub plugin_javascript {
+my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
+my $function_name= "210c".(int(rand(100000))+1);
+
+# find today's date
+my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
+                                                               localtime(time);
+$year +=1900;
+$mon +=1;
+my $date = "$year-$mon-$mday";
+my $res  = "
+<script>
+function Blur$function_name(index) {
+//need this?
+}
+
+function Focus$function_name(subfield_managed) {
+	for (i=0 ; i<document.f.field_value.length ; i++) {
+                if (document.f.tag[i].value == '952' && document.f.subfield[i].value == 'v') {
+                        document.f.field_value[i].value = '$date';
+                }
+        }
+return 0;
+}
+
+function Clic$function_name(subfield_managed) {
+}
+</script>
+";
+return ($function_name,$res);
+}
+
+=head1
+
+plugin : the true value_builded. The screen that is open in the popup window.
+
+=cut
+
+sub plugin {
+my ($input) = @_;
+return "";
+}
+
+1;





More information about the Koha-cvs mailing list