koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] koha/cataloguing addbiblio-nomarc.pl additem-no...


From: paul poulain
Subject: [Koha-cvs] koha/cataloguing addbiblio-nomarc.pl additem-no...
Date: Fri, 09 Mar 2007 15:36:11 +0000

CVSROOT:        /sources/koha
Module name:    koha
Changes by:     paul poulain <tipaul>   07/03/09 15:36:10

Added files:
        cataloguing    : addbiblio-nomarc.pl additem-nomarc.pl 
                         plugin_launcher.pl savebiblio.pl saveitem.pl 
                         thesaurus_popup.pl z3950_search.pl 
        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_authorities.pl 
                                   marc21_field_008.pl 
                                   marc21_field_040c.pl 
                                   marc21_field_040d.pl 
                                   marc21_leader_authorities.pl 
                                   marc21_leader_book.pl 
                                   marc21_leader_computerfile.pl 
                                   marc21_leader.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_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_124.pl 
                                   unimarc_field_125a.pl 
                                   unimarc_field_125b.pl 
                                   unimarc_field_125.pl 
                                   unimarc_field_126a.pl 
                                   unimarc_field_126b.pl 
                                   unimarc_field_126.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:
        rel_3_0 moved to HEAD (introducing new files)

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

Patches:
Index: addbiblio-nomarc.pl
===================================================================
RCS file: addbiblio-nomarc.pl
diff -N addbiblio-nomarc.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ addbiblio-nomarc.pl 9 Mar 2007 15:36:10 -0000       1.3
@@ -0,0 +1,77 @@
+#!/usr/bin/perl
+
+# $Id: addbiblio-nomarc.pl,v 1.3 2007/03/09 15:36:10 tipaul Exp $
+
+#
+# TODO
+#
+# Add info on biblioitems and items already entered as you enter new ones
+#
+
+# 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
+
+# $Log: addbiblio-nomarc.pl,v $
+# Revision 1.3  2007/03/09 15:36:10  tipaul
+# rel_3_0 moved to HEAD (introducing new files)
+#
+# Revision 1.1.2.2  2006/12/18 16:35:18  toins
+# removing use HTML::Template from *.pl.
+#
+# Revision 1.1.2.1  2006/09/26 16:05:05  toins
+# adding missing template & fix wrong link on scripts.
+#
+# Revision 1.1  2006/01/17 16:40:54  tipaul
+# moving acqui.simple directory to cataloguing, as acqui.simple contains 
cataloguing scripts...
+#
+# Revision 1.3  2005/05/04 08:45:22  tipaul
+# synch'ing 2.2 and head
+#
+# Revision 1.2.4.1  2005/03/25 12:52:42  tipaul
+# needs "editcatalogue" flag, not "catalogue"
+#
+# Revision 1.2  2003/05/09 23:47:22  rangi
+# This script is now templated
+# 3 more to go i think
+#
+
+use CGI;
+use strict;
+use C4::Output;
+
+use C4::Auth;
+use C4::Interface::CGI::Output;
+
+my $input = new CGI;
+my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+    {
+        template_name   => "cataloguing/addbiblio-nomarc.tmpl",
+        query           => $input,
+        type            => "intranet",
+        authnotrequired => 0,
+        flagsrequired   => { editcatalogue => 1 },
+        debug           => 1,
+    }
+);
+
+my $error = $input->param('error');
+
+$template->param(
+    ERROR => $error,
+);
+
+output_html_with_http_headers $input, $cookie, $template->output;

Index: additem-nomarc.pl
===================================================================
RCS file: additem-nomarc.pl
diff -N additem-nomarc.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ additem-nomarc.pl   9 Mar 2007 15:36:10 -0000       1.6
@@ -0,0 +1,235 @@
+#!/usr/bin/perl
+
+# $Id: additem-nomarc.pl,v 1.6 2007/03/09 15:36:10 tipaul 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
+
+# $Log: additem-nomarc.pl,v $
+# Revision 1.6  2007/03/09 15:36:10  tipaul
+# rel_3_0 moved to HEAD (introducing new files)
+#
+# Revision 1.4.2.3  2006/12/14 15:41:54  toins
+# admin/branches.pl works now with mod_perl.
+# New module : Branch.pm containt all functions dealings with branches.
+#
+# Revision 1.4.2.2  2006/12/05 11:35:30  toins
+# Biblio.pm cleaned.
+# additionalauthors, bibliosubject, bibliosubtitle tables are now unused.
+# Some functions renamed according to the coding guidelines.
+#
+# Revision 1.4.2.1  2006/09/26 16:05:05  toins
+# adding missing template & fix wrong link on scripts.
+#
+# Revision 1.4  2006/07/27 13:52:49  toins
+# 1 sub renamed and cleaned.
+#
+# Revision 1.3  2006/07/21 10:12:00  toins
+# subs renamed according to coding guidelines.
+#
+# Revision 1.2  2006/07/12 17:17:12  toins
+# getitemtypes renamed to GetItemTypes
+#
+# Revision 1.1  2006/01/17 16:40:54  tipaul
+# moving acqui.simple directory to cataloguing, as acqui.simple contains 
cataloguing scripts...
+#
+# Revision 1.8  2005/10/26 09:11:34  tipaul
+# big commit, still breaking things...
+#
+# * synch with rel_2_2. Probably the last non manual synch, as rel_2_2 should 
not be modified deeply.
+# * code cleaning (cleaning warnings from perl -w) continued
+#
+# Revision 1.4.2.1  2005/03/25 12:52:44  tipaul
+# needs "editcatalogue" flag, not "catalogue"
+#
+# Revision 1.4  2004/11/19 16:41:49  tipaul
+# improving behaviour when MARC=OFF
+#
+# Revision 1.3  2004/08/13 16:37:25  tipaul
+# adding frameworkcode to API in some subs
+#
+# Revision 1.2  2003/05/11 06:59:11  rangi
+# Mostly templated.
+# Still needs some work
+#
+
+use CGI;
+use strict;
+use C4::Biblio;
+use C4::Koha;
+use C4::Output;
+use C4::Branch; # GetBranches
+use C4::Auth;
+use C4::Interface::CGI::Output;
+
+my $input        = new CGI;
+my $biblionumber = $input->param('biblionumber');
+my $error        = $input->param('error');
+my $maxbarcode;
+my $isbn;
+my $bibliocount;
+my @biblios;
+my $biblioitemcount;
+my @biblioitems;
+# my @branches;
+# my %branchnames;
+my $itemcount;
+my @items;
+
+if ( !$biblionumber ) {
+    print $input->redirect('/cgi-bin/koha/cataloguing/addbooks.pl');
+}
+else {
+    my $input = new CGI;
+    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+        {
+            template_name   => "cataloguing/additem-nomarc.tmpl",
+            query           => $input,
+            type            => "intranet",
+            authnotrequired => 0,
+            flagsrequired   => { editcatalogue => 1 },
+            debug           => 1,
+        }
+    );
+    ( $bibliocount, @biblios ) = &GetBiblio($biblionumber);
+
+    if ( !$bibliocount ) {
+        print $input->redirect('addbooks.pl');
+    }
+    else {
+        @biblioitems = &GetBiblioItemByBiblioNumber($biblionumber);
+        $biblioitemcount = scalar @biblioitems;
+        my $branches = GetBranches;
+        my @branchloop;
+        foreach my $thisbranch (sort keys %$branches) {
+            my %row =(value => $thisbranch,
+                        branchname => $branches->{$thisbranch}->{'branchname'},
+                    );
+            push @branchloop, \%row;
+        }
+        my $itemtypes = &GetItemTypes;
+        my @itemtypeloop;
+        foreach my $thisitemtype (sort keys %$itemtypes) {
+            my %row =(value => $thisitemtype,
+                        description => 
$itemtypes->{$thisitemtype}->{'description'},
+                    );
+            push @itemtypeloop, \%row;
+        }
+        if ( $error eq "nobarcode" ) {
+            $template->param( NOBARCODE => 1 );
+        }
+        elsif ( $error eq "nobiblioitem" ) {
+            $template->param( NOBIBLIOITEM => 1 );
+        }
+        elsif ( $error eq "barcodeinuse" ) {
+            $template->param( BARCODEINUSE => 1 );
+        }    # elsif
+
+        for ( my $i = 0 ; $i < $biblioitemcount ; $i++ ) {
+            if ( $biblioitems[$i]->{'itemtype'} eq "WEB" ) {
+                $biblioitems[$i]->{'WEB'} = 1;
+            }
+            $biblioitems[$i]->{'dewey'} =~ /(\d*\.\d\d)/;
+            $biblioitems[$i]->{'dewey'} = $1;
+            ( $itemcount, @items ) = &getitemsbybiblioitem( 
$biblioitems[$i]->{'biblioitemnumber'} );
+            $biblioitems[$i]->{'items'} = address@hidden;
+        }    # for
+        $template->param(
+            BIBNUM    => $biblionumber,
+            AUTHOR    => $biblios[0]->{'author'},
+            TITLE     => $biblios[0]->{'title'},
+            COPYRIGHT => $biblios[0]->{'copyrightdate'},
+            SERIES    => $biblios[0]->{'seriestitle'},
+            NOTES     => $biblios[0]->{'notes'},
+            BIBITEMS  => address@hidden,
+            branchloop  => address@hidden,
+            itemtypeloop => address@hidden,
+
+    ( $bibliocount, @biblios ) = &GetBiblio($biblionumber);
+
+    if ( !$bibliocount ) {
+        print $input->redirect('addbooks.pl');
+    }
+    else {
+
+        @biblioitems =&GetBiblioItemByBiblioNumber($biblionumber);
+        $biblioitemcount = scalar @biblioitems;
+        @branches   = &GetBranches;
+        ( $itemtypecount, @itemtypes ) = &GetItemTypes;
+
+        for ( my $i = 0 ; $i < $itemtypecount ; $i++ ) {
+            $itemtypedescriptions{ $itemtypes[$i]->{'itemtype'} } =
+              $itemtypes[$i]->{'description'};
+        }    # for
+
+        for ( my $i = 0 ; $i < $#branches ; $i++ ) {
+            $branchnames{ $branches[$i]->{'branchcode'} } =
+              $branches[$i]->{'branchname'};
+        }    # for
+
+        #    print $input->header;
+        #    print startpage();
+        #    print startmenu('acquisitions');
+        my $input = new CGI;
+        my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+            {
+                template_name   => "cataloguing/additem-nomarc.tmpl",
+                query           => $input,
+                type            => "intranet",
+                authnotrequired => 0,
+                flagsrequired   => { editcatalogue => 1 },
+                debug           => 1,
+            }
+        );
+
+        if ( $error eq "nobarcode" ) {
+            $template->param( NOBARCODE => 1 );
+        }
+        elsif ( $error eq "nobiblioitem" ) {
+            $template->param( NOBIBLIOITEM => 1 );
+        }
+        elsif ( $error eq "barcodeinuse" ) {
+            $template->param( BARCODEINUSE => 1 );
+        }    # elsif
+
+        for ( my $i = 0 ; $i < $biblioitemcount ; $i++ ) {
+            if ( $biblioitems[$i]->{'itemtype'} eq "WEB" ) {
+                $biblioitems[$i]->{'WEB'} = 1;
+
+            }
+            $biblioitems[$i]->{'dewey'} =~ /(\d*\.\d\d)/;
+            $biblioitems[$i]->{'dewey'} = $1;
+            ( $itemcount, @items ) =
+              &getitemsbybiblioitem( $biblioitems[$i]->{'biblioitemnumber'} );
+            $biblioitems[$i]->{'items'} = address@hidden;
+        }    # for
+        $template->param(
+            BIBNUM    => $biblionumber,
+            AUTHOR    => $biblios[0]->{'author'},
+            TITLE     => $biblios[0]->{'title'},
+            COPYRIGHT => $biblios[0]->{'copyrightdate'},
+            SERIES    => $biblios[0]->{'seriestitle'},
+            NOTES     => $biblios[0]->{'notes'},
+            BIBITEMS  => address@hidden,
+            BRANCHES  => address@hidden,
+            ITEMTYPES => address@hidden,
+
+        );
+
+        output_html_with_http_headers $input, $cookie, $template->output;
+    }    # if
+}    # if

Index: plugin_launcher.pl
===================================================================
RCS file: plugin_launcher.pl
diff -N plugin_launcher.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ plugin_launcher.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,39 @@
+#!/usr/bin/perl
+
+# $Id: plugin_launcher.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 CGI;
+use C4::Context;
+
+use C4::Output;
+
+my $input = new CGI;
+my $plugin_name=$input->param("plugin_name");
+my $plugin_name="cataloguing/value_builder/".$input->param("plugin_name");
+
+# opening plugin. Just check wether we are on a developper computer on a 
production one
+# (the cgidir differs)
+my $cgidir = C4::Context->intranetdir ."/cgi-bin";
+unless (opendir(DIR, "$cgidir/cataloguing/value_builder")) {
+       $cgidir = C4::Context->intranetdir;
+}
+do $cgidir."/".$plugin_name;
+&plugin($input);

Index: savebiblio.pl
===================================================================
RCS file: savebiblio.pl
diff -N savebiblio.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ savebiblio.pl       9 Mar 2007 15:36:10 -0000       1.3
@@ -0,0 +1,53 @@
+#!/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 CGI;
+use strict;
+use C4::Biblio;
+
+my $input  = new CGI;
+my $biblio = {
+    title    => $input->param('title'),
+    subtitle => $input->param('subtitle') ? $input->param('subtitle') : "",
+    author   => $input->param('author') ? $input->param('author') : "",
+    seriestitle => $input->param('seriestitle') ? $input->param('seriestitle')
+    : "",
+    copyrightdate => $input->param('copyrightdate')
+    ? $input->param('copyrightdate')
+    : "",
+    abstract => $input->param('abstract') ? $input->param('abstract') : "",
+    notes    => $input->param('notes')    ? $input->param('notes')    : ""
+};    # my $biblio
+
+my $subjectheadings = $input->param('subjectheadings');
+# Different O.S.es use different codes to end lines. This ensures that all 
cases
+# are allowed for.
+my @subjects = split ( /\n|\r|\n\r|\r\n/, $subjectheadings );
+my $biblionumber;
+my $aauthors = $input->param('additionalauthors');
+my @authors  = split ( /\n|\r|\n\r|\r\n/, $aauthors );
+my $force    = $input->param('force');
+
+if ( !$biblio->{'title'} ) {
+    print $input->redirect('addbiblio-nomarc.pl?error=notitle');
+}
+else {
+    $biblionumber = &newbiblio($biblio);
+    print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber");
+}    # else

Index: saveitem.pl
===================================================================
RCS file: saveitem.pl
diff -N saveitem.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ saveitem.pl 9 Mar 2007 15:36:10 -0000       1.3
@@ -0,0 +1,95 @@
+#!/usr/bin/perl
+
+# $Id: saveitem.pl,v 1.3 2007/03/09 15:36:10 tipaul 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 CGI;
+use strict;
+# use C4::Catalogue;
+use C4::Biblio;
+
+my $input            = new CGI;
+my $barcode          = $input->param('barcode');
+my $biblionumber     = $input->param('biblionumber');
+my $biblioitemnumber = $input->param('biblioitemnumber');
+my $item             = {
+    biblionumber     => $biblionumber,
+    biblioitemnumber => $biblioitemnumber?$biblioitemnumber:"",
+    homebranch       => $input->param('homebranch'),
+    holdingbranch       => $input->param('homebranch'),
+    replacementprice => 
$input->param('replacementprice')?$input->param('replacementprice'):"",
+    itemnotes        => $input->param('notes')?$input->param('notes'):""
+}; # my $item
+my $biblioitem       = {
+    biblionumber      => $biblionumber,
+    itemtype          => $input->param('itemtype'),
+    isbn              => $input->param('isbn')?$input->param('isbn'):"",
+    publishercode     => 
$input->param('publishercode')?$input->param('publishercode'):"",
+    publicationyear   => 
$input->param('publicationyear')?$input->param('publicationyear'):"",
+    place             => $input->param('place')?$input->param('place'):"",
+    illus             => $input->param('illus')?$input->param('illus'):"",
+    url               => $input->param('url')?$input->param('url'):"",
+    dewey             => $input->param('dewey')?$input->param('dewey'):"",
+    subclass          => 
$input->param('subclass')?$input->param('subclass'):"",
+    issn              => $input->param('issn')?$input->param('issn'):"",
+    lccn              => $input->param('lccn')?$input->param('lccn'):"",
+    volume            => $input->param('volume')?$input->param('volume'):"",
+    number            => $input->param('number')?$input->param('number'):"",
+    volumeddesc       => 
$input->param('volumeddesc')?$input->param('volumeddesc'):"",
+    pages             => $input->param('pages')?$input->param('pages'):"",
+    size              => $input->param('size')?$input->param('size'):"",
+    notes             => 
$input->param('itemnotes')?$input->param('itemnotes'):""
+}; # my biblioitem
+my $newgroup = 0;
+my $website  = 0;
+my $count;
+my @results;
+
+if ($input->param('newgroup')) {
+    $newgroup = 1;
+    if ($biblioitem->{'itemtype'} eq "WEB") {
+       $website = 1;
+    } # if
+} # if
+
+if (! $biblionumber) {
+    print $input->redirect('addbooks.pl');
+} elsif ((! $barcode) && (! $website)) {
+    print 
$input->redirect("additem-nomarc.pl?biblionumber=$biblionumber&error=nobarcode");
+} elsif ((! $newgroup) && (! $biblioitemnumber)) {
+    print 
$input->redirect("additem-nomarc.pl?biblionumber=$biblionumber&error=nobiblioitem");
+} else {
+
+    if ($website) {
+       &newbiblioitem($biblioitem);
+               print 
$input->redirect("additem-nomarc.pl?biblionumber=$biblionumber");
+    } elsif (&checkitems(1,$barcode)) {
+       print 
$input->redirect("additem-nomarc.pl?biblionumber=$biblionumber&error=barcodeinuse");
+    } else {
+
+       if ($newgroup) {
+           $biblioitemnumber = &newbiblioitem($biblioitem);
+           $item->{'biblioitemnumber'} = $biblioitemnumber;
+       } # if
+
+       &newitems($item, ($barcode));
+
+       print $input->redirect("additem-nomarc.pl?biblionumber=$biblionumber");
+    } # else
+} # else

Index: thesaurus_popup.pl
===================================================================
RCS file: thesaurus_popup.pl
diff -N thesaurus_popup.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ thesaurus_popup.pl  9 Mar 2007 15:36:10 -0000       1.3
@@ -0,0 +1,125 @@
+#!/usr/bin/perl
+
+# written 10/5/2002 by Paul
+# build result field using bibliothesaurus table
+
+
+# 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 C4::Output;
+use C4::Authorities;
+use C4::Interface::CGI::Output;
+# get all the data ....
+my %env;
+
+my $input = new CGI;
+my $result = $input->param('result');
+my $search_string= $input->param('search_string');
+$search_string = $result unless ($search_string);
+my $op = $input->param('op');
+my $id = $input->param('id');
+my $category = $input->param('category');
+my $index= $input->param('index');
+my $insert = $input->param('insert');
+my $nohierarchy = $input->param('nohierarchy'); # if 1, just show the last 
part of entry (Marseille). If 0, show everything (Europe -- France --Marseille)
+my $dbh = C4::Context->dbh;
+
+# make the page ...
+#print $input->header;
+if ($op eq "select") {
+       my $sti = $dbh->prepare("select father,stdlib from bibliothesaurus 
where id=?");
+       $sti->execute($id);
+       my ($father,$freelib_text) = $sti->fetchrow_array;
+       if (length($result)>0) {
+               if ($nohierarchy) {
+                       $result .= "|$freelib_text";
+               } else {
+                       $result .= "|$father $freelib_text";
+               }
+       } else {
+               if ($nohierarchy) {
+                       $result = "$freelib_text";
+               } else {
+                       $result = "$father $freelib_text";
+               }
+       }
+}
+if ($op eq "add") {
+       newauthority($dbh,$category,$insert,$insert,'',1,'');
+       $search_string=$insert;
+}
+my ($template, $loggedinuser, $cookie)
+    = get_template_and_user({template_name => 
"cataloguing/thesaurus_popup.tmpl",
+                            query => $input,
+                            type => "intranet",
+                            authnotrequired => 0,
+                            flagsrequired => {editcatalogue => 1},
+                            debug => 1,
+                            });
+# /search thesaurus terms starting by search_string
+my @freelib;
+my %stdlib;
+my $select_list;
+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,father from bibliothesaurus 
where match (category,freelib) AGAINST (?) and category =?");
+       $sti->execute($search_string,$category);
+       while (my $line=$sti->fetchrow_hashref) {
+               if ($nohierarchy) {
+                       $stdlib{$line->{'id'}} = "$line->{'freelib'}";
+               } else {
+                       $stdlib{$line->{'id'}} = "$line->{'father'} 
$line->{'freelib'}";
+               }
+               push(@freelib,$line->{'id'});
+       }
+       $select_list= CGI::scrolling_list( -name=>'id',
+                       -values=> address@hidden,
+                       -default=> "",
+                       -size=>1,
+                       -multiple=>0,
+                       -labels=> \%stdlib
+                       );
+}
+my @x = SearchDeeper('',$category,$search_string);
+#my @son;
+#foreach (my $value @$x) {
+#      warn address@hidden>{'stdlib'};
+#}
+my $dig_list= CGI::scrolling_list( -name=>'search_string',
+               -values=> address@hidden,
+               -default=> "",
+               -size=>1,
+               -multiple=>0,
+               );
+
+$template->param(select_list => $select_list,
+                                               search_string => $search_string,
+                                               dig_list => $dig_list,
+                                               result => $result,
+                                               category => $category,
+                                               index => $index,
+                                               nohierarchy => $nohierarchy,
+                                               );
+output_html_with_http_headers $input, $cookie, $template->output;
+
+

Index: z3950_search.pl
===================================================================
RCS file: z3950_search.pl
diff -N z3950_search.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ z3950_search.pl     9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,216 @@
+#!/usr/bin/perl
+# This is a completely new Z3950 clients search using async ZOOM -TG 02/11/06
+# 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 CGI;
+
+use C4::Auth;
+use C4::Output;
+use C4::Interface::CGI::Output;
+use C4::Biblio;
+use C4::Context;
+use C4::Breeding;
+use C4::Koha;
+use ZOOM;
+
+my $input = new CGI;
+my $dbh = C4::Context->dbh;
+my $error = $input->param('error');
+my $biblionumber=$input->param('biblionumber');
+$biblionumber=0 unless $biblionumber;
+my $frameworkcode=$input->param('frameworkcode');
+my $title = $input->param('title');
+my $author = $input->param('author');
+my $isbn = $input->param('isbn');
+my $issn = $input->param('issn');
+my $random = $input->param('random');
+my $op=$input->param('op');
+my $noconnection;
+my $numberpending;
+my $attr='';
+my $term;
+my $host;
+my $server;
+my $database;
+my $port;
+my $marcdata;
+my @encoding;
+my @results;
+my $count;
+my $toggle;
+my $record;
+my $oldbiblio;
+my $dbh = C4::Context->dbh;
+my $errmsg;
+my @serverloop=();
+my @serverhost;
+my @breeding_loop = ();
+
+my $DEBUG = 1; # if set to 1, many debug message are send on syslog.
+
+unless ($random) { # this var is not useful anymore just kept to keep rel2_2 
compatibility
+    $random =rand(1000000000);
+}
+
+my ($template, $loggedinuser, $cookie)= get_template_and_user({
+                template_name => "cataloguing/z3950_search.tmpl",
+                query => $input,
+                type => "intranet",
+                authnotrequired => 1,
+                flagsrequired => {catalogue => 1},
+                debug => 1,
+                });
+
+$template->param(
+        intranetcolorstylesheet => 
C4::Context->preference("intranetcolorstylesheet"),
+        intranetstylesheet => C4::Context->preference("intranetstylesheet"),
+        IntranetNav => C4::Context->preference("IntranetNav"),
+        frameworkcode => $frameworkcode,
+        );
+
+if ($op ne "do_search"){
+    my $sth=$dbh->prepare("select id,host,checked from z3950servers  order by 
host");
+    $sth->execute();
+    my $serverloop=$sth->fetchall_arrayref({});
+    $template->param(isbn=>$isbn, issn=>$issn,title=>$title,author=>$author,
+                        serverloop => $serverloop,
+                        opsearch => "search",
+                        biblionumber => $biblionumber,
+                        );
+    output_html_with_http_headers $input, $cookie, $template->output;
+}else{
+    my @id=$input->param('id');
+    my @oConnection;
+    my @oResult;
+    my $s=0;
+                            
+    if ($isbn || $issn) {
+               $attr='1=7';
+#          warn "isbn : $isbn";
+               $term=$isbn if ($isbn);
+               $term=$issn if ($issn);
+       } elsif ($title) {
+               $attr='1=4 ';
+        utf8::decode($title);
+        $title=~tr/àâäéèêëîïôöùû/aaaeeeeiioouu/;
+               $term=$title;
+       } elsif ($author) {
+               $attr='1=1003';
+        utf8::decode($author);
+        $author=~tr/àâäéèêëîïôöùû/aaaeeeeiioouu/;
+               $term=$author;
+       }
+
+    my $query="address@hidden $attr \"$term\"";        
+    warn "query ".$query if $DEBUG;
+    foreach my $servid (@id){
+        my $sth=$dbh->prepare("select * from z3950servers where id=?");
+        $sth->execute($servid);
+        while ($server=$sth->fetchrow_hashref) {
+            my $noconnection=0;                                                
        
+            my $option1=new ZOOM::Options();
+            $option1->option('async'=>1);
+            $option1->option('elementSetName', 'F');
+            $option1->option('databaseName',$server->{db})  ;
+            $option1->option('user',$server->{userid}) if $server->{userid};
+            $option1->option('password',$server->{password})  if 
$server->{password};
+            $option1->option('preferredRecordSyntax', $server->{syntax});
+            $oConnection[$s]=create ZOOM::Connection($option1) || $DEBUG && 
warn ("something went wrong: ".$oConnection[$s]->errmsg());
+            warn ("server data",$server->{name}, $server->{port}) if $DEBUG;
+            $oConnection[$s]->connect($server->{host}, $server->{port}) || 
$DEBUG && warn ("something went wrong: ".$oConnection[$s]->errmsg());
+            $serverhost[$s]=$server->{host};
+            $encoding[$s]=$server->{syntax};
+            $s++;
+        }## while fetch
+    }# foreach
+    my $nremaining = $s;
+    my $firstresult=1;
+
+    for (my $z=0 ;$z<$s;$z++){
+        warn "doing the search" if $DEBUG;
+        $oResult[$z] = $oConnection[$z]->search_pqf($query) || $DEBUG && warn 
("somthing went wrong: " . $oConnection[$s]->errmsg());
+#$oResult[$z] = $oConnection[$z]->search_pqf($query);
+    }
+
+AGAIN:
+    my $k;
+    my $event;
+    while (($k = ZOOM::event(address@hidden)) != 0) {
+        $event = $oConnection[$k-1]->last_event();
+        warn ("connection ", $k-1, ": event $event (", 
ZOOM::event_str($event), ")\n") if $DEBUG;
+        last if $event == ZOOM::Event::ZEND;
+    }
+
+    if ($k != 0) {
+        $k--;
+        warn $serverhost[$k] if $DEBUG;
+        my($error, $errmsg, $addinfo, $diagset) = $oConnection[$k]->error_x();
+        if ($error) {
+            warn "$k $serverhost[$k] error $query: $errmsg ($error) 
$addinfo\n" if $DEBUG;
+            
+        } else {
+          my $numresults=$oResult[$k]->size() ;
+          my $i;
+          my $result='';
+          if ($numresults>0){
+              for ($i=0; $i<(($numresults<20) ? ($numresults) : (20)) ; $i++) {
+                  my $rec=$oResult[$k]->record($i);
+                  my $marcrecord;
+                  $marcdata = $rec->raw();
+                  $marcrecord= FixEncoding($marcdata);
+  ####WARNING records coming from Z3950 clients are in various character sets 
MARC8,UTF8,UNIMARC etc
+  ## In HEAD i change everything to UTF-8
+  # In rel2_2 i am not sure what encoding is so no character conversion is 
done here
+  ##Add necessary encoding changes to here -TG
+                  my $oldbiblio = MARCmarc2koha($dbh,$marcrecord,"");
+                  $oldbiblio->{isbn} =~ s/ |-|\.//g,
+                  $oldbiblio->{issn} =~ s/ |-|\.//g,
+                  my 
($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported,$breedingid)=ImportBreeding($marcdata,1,$serverhost[$k],$encoding[$k],$random);
+                  my %row_data;
+                  if ($i % 2) {
+                      $toggle="#ffffcc";
+                  } else {
+                      $toggle="white";
+                  }
+                  $row_data{toggle} = $toggle;
+                  $row_data{server} = $serverhost[$k];
+                  $row_data{isbn} = $oldbiblio->{isbn};
+                  $row_data{title} =$oldbiblio->{title};
+                  $row_data{author} = $oldbiblio->{author};
+                  $row_data{breedingid} = $breedingid;
+                  $row_data{biblionumber}=$biblionumber;
+                  push (@breeding_loop, \%row_data);
+              }# upto 5 results
+          }#$numresults
+        }
+    }# if $k !=0
+    $numberpending=$nremaining-1;
+    $template->param(breeding_loop => address@hidden, server=>$serverhost[$k],
+                numberpending => $numberpending,
+    );
+    output_html_with_http_headers $input, $cookie, $template->output if 
$numberpending==0;
+
+#      print  $template->output  if $firstresult !=1;
+    $firstresult++;
+
+    MAYBE_AGAIN:
+        if (--$nremaining > 0) {
+            goto AGAIN;
+        }
+} ## if op=search

Index: value_builder/labs_theses.pl
===================================================================
RCS file: value_builder/labs_theses.pl
diff -N value_builder/labs_theses.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/labs_theses.pl        9 Mar 2007 15:36:10 -0000       1.2
@@ -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 C4::Interface::CGI::Output;
+use C4::Context;
+use C4::Auth;
+use C4::Output;
+
+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 => address@hidden,
+                                               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=>address@hidden,
+                                                               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: value_builder/marc21_field_003.pl
===================================================================
RCS file: value_builder/marc21_field_003.pl
diff -N value_builder/marc21_field_003.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_003.pl   9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_003.pl,v 1.2 2007/03/09 15:36:10 tipaul 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;
+
+
+=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: value_builder/marc21_field_005.pl
===================================================================
RCS file: value_builder/marc21_field_005.pl
diff -N value_builder/marc21_field_005.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_005.pl   9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,119 @@
+
+#!/usr/bin/perl
+
+# $Id: marc21_field_005.pl,v 1.2 2007/03/09 15:36:10 tipaul 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;
+
+
+=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: value_builder/marc21_field_006.pl
===================================================================
RCS file: value_builder/marc21_field_006.pl
diff -N value_builder/marc21_field_006.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_006.pl   9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,126 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_006.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_field_007.pl
===================================================================
RCS file: value_builder/marc21_field_007.pl
diff -N value_builder/marc21_field_007.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_007.pl   9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,96 @@
+
+#!/usr/bin/perl
+
+# $Id: marc21_field_007.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_field_008_authorities.pl
===================================================================
RCS file: value_builder/marc21_field_008_authorities.pl
diff -N value_builder/marc21_field_008_authorities.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_008_authorities.pl       9 Mar 2007 15:36:10 
-0000       1.2
@@ -0,0 +1,151 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_008_authorities.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_field_008.pl
===================================================================
RCS file: value_builder/marc21_field_008.pl
diff -N value_builder/marc21_field_008.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_008.pl   9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,155 @@
+
+#!/usr/bin/perl
+
+# $Id: marc21_field_008.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_field_040c.pl
===================================================================
RCS file: value_builder/marc21_field_040c.pl
diff -N value_builder/marc21_field_040c.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_040c.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_040c.pl,v 1.2 2007/03/09 15:36:10 tipaul 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;
+
+
+=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 == '040' && 
document.f.subfield[i].value == 'c') {
+                        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: value_builder/marc21_field_040d.pl
===================================================================
RCS file: value_builder/marc21_field_040d.pl
diff -N value_builder/marc21_field_040d.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_field_040d.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# $Id: marc21_field_040d.pl,v 1.2 2007/03/09 15:36:10 tipaul 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;
+
+
+=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 == '040' && 
document.f.subfield[i].value == 'd') {
+                        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: value_builder/marc21_leader_authorities.pl
===================================================================
RCS file: value_builder/marc21_leader_authorities.pl
diff -N value_builder/marc21_leader_authorities.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_leader_authorities.pl  9 Mar 2007 15:36:10 -0000       
1.2
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_authorities.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_leader_book.pl
===================================================================
RCS file: value_builder/marc21_leader_book.pl
diff -N value_builder/marc21_leader_book.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_leader_book.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,107 @@
+
+#!/usr/bin/perl
+
+# $Id: marc21_leader_book.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_leader_computerfile.pl
===================================================================
RCS file: value_builder/marc21_leader_computerfile.pl
diff -N value_builder/marc21_leader_computerfile.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_leader_computerfile.pl 9 Mar 2007 15:36:10 -0000       
1.2
@@ -0,0 +1,108 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_computerfile.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_leader.pl
===================================================================
RCS file: value_builder/marc21_leader.pl
diff -N value_builder/marc21_leader.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_leader.pl      9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,114 @@
+
+#!/usr/bin/perl
+
+# $Id: marc21_leader.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/marc21_leader_video.pl
===================================================================
RCS file: value_builder/marc21_leader_video.pl
diff -N value_builder/marc21_leader_video.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/marc21_leader_video.pl        9 Mar 2007 15:36:10 -0000       
1.2
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: marc21_leader_video.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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: value_builder/unimarc_field_100.pl
===================================================================
RCS file: value_builder/unimarc_field_100.pl
diff -N value_builder/unimarc_field_100.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_100.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,130 @@
+
+#!/usr/bin/perl
+
+# $Id: unimarc_field_100.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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=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 => 
"cataloguing/value_builder/unimarc_field_100.tmpl",
+            query         => $input,
+            type          => "intranet",
+            authnotrequired => 0,
+            flagsrequired   => { editcatalogue => 1 },
+            debug           => 1,
+        }
+    );
+    $result = '        d        u  y0frey50      ba' unless $result;
+    my $f1 = substr( $result, 0, 8 );
+    if ( $f1 eq '        ' ) {
+        my @today = Date::Calc::Today();
+        $f1 = $today[0] . sprintf('%02s',$today[1]) . 
sprintf('%02s',$today[2]);
+    }
+    my $f2  = substr( $result, 8,  1 );
+    my $f3  = substr( $result, 9,  4 );
+    $f3='' if $f3 eq '    '; # empty publication year if only spaces, 
otherwise it's hard to fill the field
+    my $f4  = substr( $result, 13, 4 );
+    $f4='' if $f4 eq '    ';
+    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: value_builder/unimarc_field_105.pl
===================================================================
RCS file: value_builder/unimarc_field_105.pl
diff -N value_builder/unimarc_field_105.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_105.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,114 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_105.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_106.pl
===================================================================
RCS file: value_builder/unimarc_field_106.pl
diff -N value_builder/unimarc_field_106.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_106.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_106.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_110.pl
===================================================================
RCS file: value_builder/unimarc_field_110.pl
diff -N value_builder/unimarc_field_110.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_110.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_110.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_115a.pl
===================================================================
RCS file: value_builder/unimarc_field_115a.pl
diff -N value_builder/unimarc_field_115a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_115a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,122 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_115a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_115b.pl
===================================================================
RCS file: value_builder/unimarc_field_115b.pl
diff -N value_builder/unimarc_field_115b.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_115b.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,108 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_115b.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_116.pl
===================================================================
RCS file: value_builder/unimarc_field_116.pl
diff -N value_builder/unimarc_field_116.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_116.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,111 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_116.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_117.pl
===================================================================
RCS file: value_builder/unimarc_field_117.pl
diff -N value_builder/unimarc_field_117.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_117.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,97 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_117.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_120.pl
===================================================================
RCS file: value_builder/unimarc_field_120.pl
diff -N value_builder/unimarc_field_120.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_120.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,106 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_120.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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 => 
"cataloguing/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: value_builder/unimarc_field_121a.pl
===================================================================
RCS file: value_builder/unimarc_field_121a.pl
diff -N value_builder/unimarc_field_121a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_121a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,102 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_121a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_121b.pl
===================================================================
RCS file: value_builder/unimarc_field_121b.pl
diff -N value_builder/unimarc_field_121b.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_121b.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,100 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_121b.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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 => 
"cataloguing/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: value_builder/unimarc_field_122.pl
===================================================================
RCS file: value_builder/unimarc_field_122.pl
diff -N value_builder/unimarc_field_122.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_122.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,96 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_122.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_123a.pl
===================================================================
RCS file: value_builder/unimarc_field_123a.pl
diff -N value_builder/unimarc_field_123a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_123d.pl
===================================================================
RCS file: value_builder/unimarc_field_123d.pl
diff -N value_builder/unimarc_field_123d.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123d.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123d.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_123e.pl
===================================================================
RCS file: value_builder/unimarc_field_123e.pl
diff -N value_builder/unimarc_field_123e.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123e.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123e.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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 => 
"cataloguing/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: value_builder/unimarc_field_123f.pl
===================================================================
RCS file: value_builder/unimarc_field_123f.pl
diff -N value_builder/unimarc_field_123f.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123f.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123f.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_123g.pl
===================================================================
RCS file: value_builder/unimarc_field_123g.pl
diff -N value_builder/unimarc_field_123g.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123g.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123g.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_123i.pl
===================================================================
RCS file: value_builder/unimarc_field_123i.pl
diff -N value_builder/unimarc_field_123i.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123i.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123i.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_123j.pl
===================================================================
RCS file: value_builder/unimarc_field_123j.pl
diff -N value_builder/unimarc_field_123j.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_123j.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_123j.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124a.pl
===================================================================
RCS file: value_builder/unimarc_field_124a.pl
diff -N value_builder/unimarc_field_124a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124b.pl
===================================================================
RCS file: value_builder/unimarc_field_124b.pl
diff -N value_builder/unimarc_field_124b.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124b.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124b.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124c.pl
===================================================================
RCS file: value_builder/unimarc_field_124c.pl
diff -N value_builder/unimarc_field_124c.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124c.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124c.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124d.pl
===================================================================
RCS file: value_builder/unimarc_field_124d.pl
diff -N value_builder/unimarc_field_124d.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124d.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124d.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124e.pl
===================================================================
RCS file: value_builder/unimarc_field_124e.pl
diff -N value_builder/unimarc_field_124e.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124e.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124e.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124f.pl
===================================================================
RCS file: value_builder/unimarc_field_124f.pl
diff -N value_builder/unimarc_field_124f.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124f.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124f.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124g.pl
===================================================================
RCS file: value_builder/unimarc_field_124g.pl
diff -N value_builder/unimarc_field_124g.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124g.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124g.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_124.pl
===================================================================
RCS file: value_builder/unimarc_field_124.pl
diff -N value_builder/unimarc_field_124.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_124.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_124.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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=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 => 
"cataloguing/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: value_builder/unimarc_field_125a.pl
===================================================================
RCS file: value_builder/unimarc_field_125a.pl
diff -N value_builder/unimarc_field_125a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_125a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,89 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_125a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_125b.pl
===================================================================
RCS file: value_builder/unimarc_field_125b.pl
diff -N value_builder/unimarc_field_125b.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_125b.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_125b.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_125.pl
===================================================================
RCS file: value_builder/unimarc_field_125.pl
diff -N value_builder/unimarc_field_125.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_125.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_125.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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=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 => 
"cataloguing/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: value_builder/unimarc_field_126a.pl
===================================================================
RCS file: value_builder/unimarc_field_126a.pl
diff -N value_builder/unimarc_field_126a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_126a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,117 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_126a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_126b.pl
===================================================================
RCS file: value_builder/unimarc_field_126b.pl
diff -N value_builder/unimarc_field_126b.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_126b.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,93 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_126b.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_126.pl
===================================================================
RCS file: value_builder/unimarc_field_126.pl
diff -N value_builder/unimarc_field_126.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_126.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,94 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_126.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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 => 
"cataloguing/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: value_builder/unimarc_field_127.pl
===================================================================
RCS file: value_builder/unimarc_field_127.pl
diff -N value_builder/unimarc_field_127.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_127.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,92 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_127.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_128a.pl
===================================================================
RCS file: value_builder/unimarc_field_128a.pl
diff -N value_builder/unimarc_field_128a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_128a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_128a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_128b.pl
===================================================================
RCS file: value_builder/unimarc_field_128b.pl
diff -N value_builder/unimarc_field_128b.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_128b.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_128b.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_128c.pl
===================================================================
RCS file: value_builder/unimarc_field_128c.pl
diff -N value_builder/unimarc_field_128c.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_128c.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,88 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_128c.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_130.pl
===================================================================
RCS file: value_builder/unimarc_field_130.pl
diff -N value_builder/unimarc_field_130.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_130.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_130.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_135a.pl
===================================================================
RCS file: value_builder/unimarc_field_135a.pl
diff -N value_builder/unimarc_field_135a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_135a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,107 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_135a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_140.pl
===================================================================
RCS file: value_builder/unimarc_field_140.pl
diff -N value_builder/unimarc_field_140.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_140.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,132 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_140.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_141.pl
===================================================================
RCS file: value_builder/unimarc_field_141.pl
diff -N value_builder/unimarc_field_141.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_141.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,104 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_141.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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['f'].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 => 
"cataloguing/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: value_builder/unimarc_field_210c.pl
===================================================================
RCS file: value_builder/unimarc_field_210c.pl
diff -N value_builder/unimarc_field_210c.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_210c.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,254 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_210c.pl,v 1.2 2007/03/09 15:36:10 tipaul 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;
+
+
+=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 type=\"text/javascript\">
+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;
+    var nb_fields = document.f.field_value.length;
+    for (i=0 ; i< nb_fields; i++) {
+        if (document.f.tag[i].value == '010' && document.f.subfield[i].value 
== 'a') {
+            isbn_found=document.f.field_value[i].value;
+            break;
+        }
+    }
+    try{
+        isbn_found.getAttribute('value'); // throw an exception if doesn't (if 
no 010a)
+    }
+    catch(e){
+        return;
+    }
+    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['f'].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, 
address@hidden,address@hidden,
+                                            address@hidden, address@hidden, 
address@hidden,
+                                            $startfrom*$resultsperpage, 
$resultsperpage,$authtypecode);# $orderby);
+    
+        ($template, $loggedinuser, $cookie)
+            = get_template_and_user({template_name => 
"cataloguing/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=>address@hidden,
+                                authtypecode =>$authtypecode,
+                                resultstring =>$value[0],
+                                );
+    } else {
+        ($template, $loggedinuser, $cookie)
+            = get_template_and_user({template_name => 
"cataloguing/value_builder/unimarc_field_210c.tmpl",
+                    query => $query,
+                    type => 'intranet',
+                    authnotrequired => 0,
+                    flagsrequired => {editcatalogue => 1},
+                    debug => 1,
+                    });
+    
+        $template->param(index => $index,
+                        resultstring => $resultstring
+                        );
+    }
+    
+    $template->param(authtypesloop => address@hidden);
+    $template->param(category => $category);
+    
+    # Print the page
+    output_html_with_http_headers $query, $cookie, $template->output;
+}
+
+1;

Index: value_builder/unimarc_field_225a.pl
===================================================================
RCS file: value_builder/unimarc_field_225a.pl
diff -N value_builder/unimarc_field_225a.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_225a.pl 9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,161 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_225a.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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 => 
"cataloguing/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=> address@hidden,
+                                                                               
                -default=>"$result",
+                                                                               
                -size=>1,
+                                                                               
                -multiple=>0,
+                                                                               
                );
+       $template->param(index => $index,
+                                                       collection => 
$collection);
+       print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: value_builder/unimarc_field_4XX.pl
===================================================================
RCS file: value_builder/unimarc_field_4XX.pl
diff -N value_builder/unimarc_field_4XX.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_4XX.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,386 @@
+#!/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 C4::Interface::CGI::Output;
+use C4::Context;
+use C4::Search;
+use C4::Auth;
+use C4::Output;
+
+use C4::Biblio;
+use C4::Koha;
+use MARC::Record;
+use C4::Branch; # GetBranches
+
+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 => 
"cataloguing/value_builder/unimarc_field_4XX.tmpl",
+                 query => $query,
+                 type => "intranet",
+                 authnotrequired => 0,
+                 flagsrequired => {editcatalogue => 1},
+                 debug => 1,
+                });
+
+        #get marc record
+        $marcrecord = GetMarcBiblio($bibnum);
+
+        my $subfield_value_9=$bibnum;
+        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->subfield('700',"b") if 
$marcrecord->subfield('700','b');
+            $subfield_value_a.=" ".$marcrecord->subfield('700',"d") if 
$marcrecord->subfield('700','d');
+            $subfield_value_a.=" (".$marcrecord->subfield('700','c')." - " if 
$marcrecord->subfield('700','c');
+            $subfield_value_a.=" (" if ($marcrecord->subfield('700','f') and 
not( $marcrecord->subfield('700','c')));
+            $subfield_value_a.=$marcrecord->subfield('700','f') if 
($marcrecord->subfield('700','f'));
+            $subfield_value_a.=")" if ($marcrecord->subfield('701','f') or 
$marcrecord->subfield('701','c'));
+        } elsif ($marcrecord->field('702')){
+            $subfield_value_a=$marcrecord->subfield('702','a');
+            $subfield_value_a.=", ".$marcrecord->subfield('702','b') if 
$marcrecord->subfield('702','b');
+            $subfield_value_a.=" ".$marcrecord->subfield('702','d') if 
$marcrecord->subfield('702','d');
+            $subfield_value_a.=" (".$marcrecord->subfield('702','c')."; " if 
$marcrecord->subfield('702','c');
+            $subfield_value_a.=" (" if $marcrecord->subfield('702','f') and 
not $marcrecord->subfield('702','c');
+            $subfield_value_a.=$marcrecord->subfield('702','f') if 
$marcrecord->subfield('702','f');
+            $subfield_value_a.=")" if $marcrecord->subfield('702','f') or 
$marcrecord->subfield('702','c');
+        } elsif ($marcrecord->field('710')){
+            $subfield_value_a=$marcrecord->subfield('710','d')." " if 
$marcrecord->subfield('710','d');
+            $subfield_value_a.=$marcrecord->subfield('710','a') if 
$marcrecord->subfield('710','a');
+            $subfield_value_a.=", ".$marcrecord->subfield('710','b') if 
$marcrecord->subfield('710');
+            $subfield_value_a.=" (".$marcrecord->subfield('710','f')." - " if 
$marcrecord->subfield('710','f');
+            $subfield_value_a.=" (" if $marcrecord->subfield('710','e') and 
not $marcrecord->subfield('710','f');
+            $subfield_value_a.=$marcrecord->subfield('710','e') if 
$marcrecord->subfield('710','e');
+            $subfield_value_a.=")" if $marcrecord->subfield('710','e') or 
$marcrecord->subfield('710','f');
+        } elsif ($marcrecord->field('701')){
+            $subfield_value_a=$marcrecord->subfield('701','a');
+            $subfield_value_a.=", ".$marcrecord->subfield('701','b') if 
$marcrecord->subfield('701','b');
+            $subfield_value_a.=" ".$marcrecord->subfield('701','d',) if 
$marcrecord->subfield('701','d');
+            $subfield_value_a.=" (".$marcrecord->subfield('701','c')." - " if 
$marcrecord->subfield('701','c');
+            $subfield_value_a.=" (" if $marcrecord->subfield('701','f') and 
not( $marcrecord->subfield('701','c'));
+            $subfield_value_a.=$marcrecord->subfield('701','f') if 
$marcrecord->subfield('701','f');
+            $subfield_value_a.=")" if $marcrecord->subfield('701','f') or 
$marcrecord->subfield('701','c');
+        } elsif ($marcrecord->field('712')){
+            $subfield_value_a=$marcrecord->subfield('712','d')." " if 
$marcrecord->subfield('712','d');
+            $subfield_value_a.=$marcrecord->subfield('712','a') if 
$marcrecord->subfield('712','a');
+            $subfield_value_a.=", ".$marcrecord->subfield('712','b') if 
$marcrecord->subfield('712','b');
+            $subfield_value_a.=" (".$marcrecord->subfield('712','f')." - " if 
$marcrecord->subfield('712','f');
+            $subfield_value_a.=" (" if $marcrecord->field('712',"e") and not 
$marcrecord->subfield('712','f');
+            $subfield_value_a.=$marcrecord->subfield('712','e') if 
$marcrecord->subfield('712','e');
+            $subfield_value_a.=")" if $marcrecord->subfield('712','e') or 
$marcrecord->subfield('712','f');
+        } elsif ($marcrecord->field('200')){
+            $subfield_value_a=$marcrecord->subfield('200','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')."",
+                        biblionumber=>$bibnum?$bibnum:"",
+                        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 $search = $query->param('search');
+        my $startfrom = $query->param('startfrom');
+        my $resultsperpage = $query->param('resultsperpage');
+        my $orderby;
+        my ($errors,$results) = SimpleSearch($search);
+        my $total=scalar(@$results);
+        $resultsperpage=20 unless $resultsperpage;
+#        warn " biblio count : ".$total;
+    
+        ($template, $loggedinuser, $cookie)
+            = get_template_and_user({template_name => 
"cataloguing/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 @arrayresults;
+        my @field_data = ($search);
+        for (my $i=$startfrom; 
$i<=(($startfrom+$resultsperpage)<scalar(@$results)?($startfrom+$resultsperpage):scalar(@$results));$i++){
+            my $record=MARC::Record::new_from_usmarc( $results->[$i] );
+            my $rechash=MARCmarc2koha($dbh,$record);
+            my $pos;
+            my $countitems=1 if ($rechash->{itemnumber});
+            while (index($rechash->{itemnumber},'|',$pos)>0){
+              $countitems+=1;
+              $pos=index($rechash->{itemnumber},'|',$pos)+1;
+            }
+            $rechash->{totitem}=$countitems;
+            my @holdingbranches=split /\|/,$rechash->{holdingbranch};
+            my @itemcallnumbers=split /\|/,$rechash->{itemcallnumber};
+            my $CN;
+            for (my $i=0;$i<@holdingbranches;$i++){
+              $CN.= $holdingbranches[$i]." ( ".$itemcallnumbers[$i]." ) |"
+            }
+            $CN=~s/ \|$//;
+            $rechash->{CN}=$CN;
+            push @arrayresults,$rechash;
+        }
+        
+#         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=> address@hidden,
+                        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 => address@hidden,
+                        index => $query->param('index')."",
+                                startfrom=> $startfrom,
+                                displaynext=> $displaynext,
+                                displayprev=> $displayprev,
+                                resultsperpage => $resultsperpage,
+                                orderby => $orderby,
+                                startfromnext => $startfrom+1,
+                                startfromprev => $startfrom-1,
+                                searchdata=>address@hidden,
+                                total=>$total,
+                                from=>$from,
+                                to=>$to,
+                                numbers=>address@hidden,
+                                searchdesc=> $searchdesc,
+                                $defaultview => 1,
+                                Search =>0
+                                );
+    
+    } else {
+        ($template, $loggedinuser, $cookie)
+            = get_template_and_user({template_name => 
"cataloguing/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   => address@hidden,
+                    -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   => address@hidden,
+                    -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   => address@hidden,
+                    -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: value_builder/unimarc_field_60X.pl
===================================================================
RCS file: value_builder/unimarc_field_60X.pl
diff -N value_builder/unimarc_field_60X.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_60X.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,118 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_60X.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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 => 
"cataloguing/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 => 
address@hidden,
+                                                       deeper => 
address@hidden,
+                               );
+       print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: value_builder/unimarc_field_700-4.pl
===================================================================
RCS file: value_builder/unimarc_field_700-4.pl
diff -N value_builder/unimarc_field_700-4.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_700-4.pl        9 Mar 2007 15:36:10 -0000       
1.2
@@ -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 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['f'].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 => 
"cataloguing/value_builder/unimarc_field_700-4.tmpl",
+                                       query => $input,
+                                       type => "intranet",
+                                       authnotrequired => 0,
+                                       flagsrequired => {editcatalogue => 1},
+                                       debug => 1,
+                                       });
+       $template->param(index => $index,
+                                                       index2 => $index2,
+                                                       "f1_$result" => 
"f1_".$result,
+                                                       );
+       print $input->header(-cookie => $cookie),$template->output;
+}
+
+1;

Index: value_builder/unimarc_field_700_701_702.pl
===================================================================
RCS file: value_builder/unimarc_field_700_701_702.pl
diff -N value_builder/unimarc_field_700_701_702.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_field_700_701_702.pl  9 Mar 2007 15:36:10 -0000       
1.2
@@ -0,0 +1,158 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_field_700_701_702.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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=> address@hidden,
+                               -default=> "",
+                               -size=>1,
+                               -multiple=>0,
+                               -labels=> \%stdlib
+                               );
+       }
+       my ($template, $loggedinuser, $cookie)
+       = get_template_and_user({template_name => 
"cataloguing/value_builder/unimarc_field_700_701_702.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,
+                                                       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: value_builder/unimarc_leader.pl
===================================================================
RCS file: value_builder/unimarc_leader.pl
diff -N value_builder/unimarc_leader.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/unimarc_leader.pl     9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,105 @@
+#!/usr/bin/perl
+
+# $Id: unimarc_leader.pl,v 1.2 2007/03/09 15:36:10 tipaul 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 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=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 => 
"cataloguing/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: value_builder/usmarc_field_952v.pl
===================================================================
RCS file: value_builder/usmarc_field_952v.pl
diff -N value_builder/usmarc_field_952v.pl
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ value_builder/usmarc_field_952v.pl  9 Mar 2007 15:36:10 -0000       1.2
@@ -0,0 +1,101 @@
+#!/usr/bin/perl
+
+# $Id: usmarc_field_952v.pl,v 1.2 2007/03/09 15:36:10 tipaul 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;
+
+
+=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;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]