View | Details | Raw Unified | Return to bug 5692
Collapse All | Expand All

(-)a/C4/Search.pm (-1 / +2 lines)
Lines 2622-2628 sub GetDistinctValues { Link Here
2622
			return $elements;
2622
			return $elements;
2623
   }
2623
   }
2624
   else {
2624
   else {
2625
		$string||= qq("");
2625
	    $string = "=" . $string if ($fieldname);
2626
	    $string||= qq("");
2626
		my @servers=qw<biblioserver authorityserver>;
2627
		my @servers=qw<biblioserver authorityserver>;
2627
		my (@zconns,@results);
2628
		my (@zconns,@results);
2628
        for ( my $i = 0 ; $i < @servers ; $i++ ) {
2629
        for ( my $i = 0 ; $i < @servers ; $i++ ) {
(-)a/cataloguing/value_builder/unimarc_field_210c_bis.pl (+109 lines)
Line 0 Link Here
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 under the
8
# terms of the GNU General Public License as published by the Free Software
9
# Foundation; either version 2 of the License, or (at your option) any later
10
# version.
11
#
12
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
15
#
16
# You should have received a copy of the GNU General Public License along
17
# with Koha; if not, write to the Free Software Foundation, Inc.,
18
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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
=over 2
40
41
=cut
42
43
use strict;
44
45
#use warnings; FIXME - Bug 2505
46
use C4::Auth;
47
use CGI;
48
use C4::Context;
49
50
use C4::AuthoritiesMarc;
51
use C4::Output;
52
53
=head1
54
55
plugin_parameters : other parameters added when the plugin is called by the dopop function
56
57
=cut
58
59
sub plugin_parameters {
60
    my ( $dbh, $record, $tagslib, $i, $tabloop ) = @_;
61
    return "";
62
}
63
64
sub plugin_javascript {
65
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
66
    my $function_name = $field_number;
67
    my $res           = "
68
    <script type=\"text/javascript\">
69
        function Focus$function_name(subfield_managed) {
70
            return 1;
71
        }
72
    
73
        function Blur$function_name(subfield_managed) {
74
            return 1;
75
        }
76
    
77
        function Clic$function_name(index) {
78
            window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_210c_bis.pl&index=\"+index,\"unimarc210c\",'width=500,height=400,toolbar=false,scrollbars=no');
79
        }
80
    </script>
81
";
82
83
    return ( $function_name, $res );
84
}
85
86
sub plugin {
87
    my ($input)      = @_;
88
    my $index        = $input->param('index');
89
    my $result       = $input->param('result');
90
    my $editor_found = $input->param('editor_found');
91
    my $authoritysep = C4::Context->preference("authoritysep");
92
93
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
94
        {   template_name   => "cataloguing/value_builder/unimarc_field_210c_bis.tmpl",
95
            query           => $input,
96
            type            => "intranet",
97
            authnotrequired => 0,
98
            flagsrequired   => { editcatalogue => '*' },
99
            debug           => 1,
100
        }
101
    );
102
103
   $template->param(
104
        index      => $index,
105
    );
106
    output_html_with_http_headers $input, $cookie, $template->output;
107
}
108
109
1;
(-)a/cataloguing/value_builder/unimarc_field_225a.pl (-1 / +1 lines)
Lines 94-100 sub plugin_javascript { Link Here
94
            }
94
            }
95
                    
95
                    
96
            defaultvalue = document.getElementById(\"$field_number\").value;
96
            defaultvalue = document.getElementById(\"$field_number\").value;
97
            window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_225a.pl&index=\"+index+\"&result=\"+defaultvalue+\"&editor_found=\"+editor_found,\"unimarc225a\",'width=500,height=200,toolbar=false,scrollbars=no');
97
            window.open(\"../cataloguing/plugin_launcher.pl?plugin_name=unimarc_field_225a.pl&index=\"+index+\"&result=\"+defaultvalue+\"&editor_found=\"+editor_found,\"unimarc225a\",'width=500,height=400,toolbar=false,scrollbars=no');
98
    
98
    
99
        }
99
        }
100
    </script>
100
    </script>
(-)a/cataloguing/ysearchzebra.pl (+52 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This software is placed under the gnu General Public License, v2 (http://www.gnu.org/licenses/gpl.html)
4
5
# Copyright 2010 BibLibre
6
#
7
# This file is part of Koha.
8
#
9
# Koha is free software; you can redistribute it and/or modify it under the
10
# terms of the GNU General Public License as published by the Free Software
11
# Foundation; either version 2 of the License, or (at your option) any later
12
# version.
13
#
14
# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16
# A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
17
#
18
# You should have received a copy of the GNU General Public License along
19
# with Koha; if not, write to the Free Software Foundation, Inc.,
20
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21
22
=head1 ysearch.pl
23
24
25
=cut
26
27
use strict;
28
29
use CGI;
30
use C4::Context;
31
use C4::Search;
32
use C4::Auth qw/check_cookie_auth/;
33
34
my $input = new CGI;
35
my $query = $input->param('query');
36
my $index = $input->param('index');
37
38
#binmode STDOUT, ":utf8";
39
print $input->header( -type => 'text/plain', -charset => 'UTF-8' );
40
41
my ( $auth_status, $sessionID ) = check_cookie_auth( $input->cookie('CGISESSID'), { cataloguing => '*' } );
42
if ( $auth_status ne "ok" ) {
43
    exit 0;
44
}
45
46
my $results = GetDistinctValues($index, $query);
47
48
foreach (@$results) {
49
    print $_->{'value'} . "\n";
50
51
}
52
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_210c_bis.tmpl (-1 / +73 lines)
Line 0 Link Here
0
- 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
<html xmlns="http://www.w3.org/1999/xhtml">
4
<head>
5
    <title>UNIMARC_Field 225a builder</title>
6
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7
    <script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/utilities/utilities.js"></script> 
8
    <script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/datasource/datasource.js"></script> 
9
    <script type="text/javascript" src="<!-- TMPL_VAR NAME="yuipath" -->/autocomplete/autocomplete-min.js"></script>
10
    <link rel="stylesheet" type="text/css" href="<!-- TMPL_VAR NAME="themelang" -->/css/staff-global.css" />
11
12
</head>
13
<body>
14
<div id="header_search">
15
<script type="text/javascript">
16
//<![CDATA[
17
YAHOO.util.Event.onContentReady("header_search", function() {
18
    new function() {
19
        // Define a custom formatter function
20
        this.fnCustomFormatter = function(oResultItem, sQuery) {
21
            var name        = oResultItem[0];
22
            var aMarkup = [
23
                "<div class=\"sample-result\">",
24
                name,
25
                "<\/div>"];
26
            return (aMarkup.join(""));
27
        };
28
29
        // Instantiate one XHR DataSource and define schema as an array:
30
        //     ["Record Delimiter",
31
        //     "Field Delimiter"]
32
        this.oACDS = new YAHOO.widget.DS_XHR("/cgi-bin/koha/cataloguing/ysearch.pl", ["\n", "\t"]);
33
        this.oACDS.scriptQueryAppend = "table=biblioitems&field=publishercode";
34
        this.oACDS.responseType = YAHOO.widget.DS_XHR.TYPE_FLAT;
35
        this.oACDS.maxCacheEntries = 60;
36
        this.oACDS.queryMatchSubset = true;
37
    
38
        // Instantiate first AutoComplete
39
        var myInput = document.getElementById('findvalue');
40
        var myContainer = document.getElementById('yvaluecontainer');
41
        this.oAutoComp = new YAHOO.widget.AutoComplete(myInput,myContainer,this.oACDS);
42
        //this.oAutoComp.delimChar = ";";
43
        this.oAutoComp.queryDelay = 1;
44
        this.oAutoComp.formatResult = this.fnCustomFormatter;
45
}
46
});    
47
//]]>
48
</script>
49
    <div id="mainbloc">
50
51
52
<div class="autocomplete">
53
        <form name="f_pop" onsubmit="javascript:report()" action="">
54
            <div id="borrowerautocomplete" class="autocomplete">
55
                <input autocomplete="off" id="findvalue" name="findvalue" size="40" class="focus" type="text" /><br /><br /> 
56
		<input id="ysearchsubmit" type="submit" class="submit" value="Submit" />
57
                <div id="yvaluecontainer"></div>
58
            </div>
59
        </form>
60
    </div>
61
</div>    
62
    <script type="text/javascript">
63
        function report() {
64
            var doc   = opener.document; 
65
            var field = doc.getElementById("<!-- TMPL_VAR NAME='index'-->");
66
            field.value =  document.f_pop.findvalue.value;
67
68
            window.close();
69
            return false;
70
        }
71
    </script>
72
</body>
73
</html>

Return to bug 5692