Bug 17117: Patron personal details not displayed unless branch update request is...
[koha.git] / cataloguing / value_builder / unimarc_field_210c_bis.pl
1 #!/usr/bin/perl
2
3 # Copyright 2000-2002 Katipo Communications
4 #
5 # This file is part of Koha.
6 #
7 # Koha is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 3 of the License, or
10 # (at your option) any later version.
11 #
12 # Koha is distributed in the hope that it will be useful, but
13 # WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
16 #
17 # You should have received a copy of the GNU General Public License
18 # along with Koha; if not, see <http://www.gnu.org/licenses>.
19
20 =head1 SYNOPSIS
21
22 This plugin is used to map isbn/editor with collection.
23 It need :
24   in thesaurus, a category named EDITORS
25   in this category, datas must be entered like following :
26   isbn separator editor separator collection.
27   for example :
28   2204 -- Cerf -- Cogitatio fidei
29   2204 -- Cerf -- Le Magistere de l'Eglise
30   2204 -- Cerf -- Lectio divina
31   2204 -- Cerf -- Lire la Bible
32   2204 -- Cerf -- Pour lire
33   2204 -- Cerf -- Sources chretiennes
34
35   when the user clic on ... on 225a line, the popup shows the list of collections from the selected editor
36   if the biblio has no isbn, then the search if done on editor only
37   If the biblio ha an isbn, the search is done on isbn and editor. It's faster.
38
39 =cut
40
41 use strict;
42
43 #use warnings; FIXME - Bug 2505
44 use C4::Auth;
45 use CGI qw ( -utf8 );
46 use C4::Context;
47
48 use C4::AuthoritiesMarc;
49 use C4::Output;
50
51 sub plugin_javascript {
52     my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
53     my $function_name = $field_number;
54     my $res           = "
55     <script type=\"text/javascript\">
56     
57     
58         function Clic$function_name(index) {
59             window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c_bis.pl&index=\"+index,\"unimarc210c\",'width=500,height=400,toolbar=false,scrollbars=no');
60         }
61     </script>
62 ";
63
64     return ( $function_name, $res );
65 }
66
67 sub plugin {
68     my ($input)      = @_;
69     my $index        = $input->param('index');
70     my $result       = $input->param('result');
71     my $editor_found = $input->param('editor_found');
72     my $AuthoritySeparator = C4::Context->preference("AuthoritySeparator");
73
74     my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
75         {   template_name   => "cataloguing/value_builder/unimarc_field_210c_bis.tt",
76             query           => $input,
77             type            => "intranet",
78             authnotrequired => 0,
79             flagsrequired   => { editcatalogue => '*' },
80             debug           => 1,
81         }
82     );
83
84    $template->param(
85         index      => $index,
86     );
87     output_html_with_http_headers $input, $cookie, $template->output;
88 }