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

(-)a/cataloguing/value_builder/marc21_field_007.pl (-99 / +103 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 19-24 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
19
21
use strict;
20
use strict;
21
22
#use warnings; FIXME - Bug 2505
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
23
use C4::Auth;
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
Lines 34-42 plugin_parameters : other parameters added when the plugin is called by the dopo Link Here
34
=cut
34
=cut
35
35
36
sub plugin_javascript {
36
sub plugin_javascript {
37
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
37
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
38
my $function_name= $field_number;
38
    my $function_name = $field_number;
39
my $res="
39
    my $res           = "
40
<script type=\"text/javascript\">
40
<script type=\"text/javascript\">
41
//<![CDATA[
41
//<![CDATA[
42
42
Lines 49-149 function Clic$function_name(i) { Link Here
49
</script>
49
</script>
50
";
50
";
51
51
52
return ($function_name,$res);
52
    return ( $function_name, $res );
53
}
53
}
54
54
sub plugin {
55
sub plugin {
55
my ($input) = @_;
56
    my ($input) = @_;
56
	my $index= $input->param('index');
57
    my $index   = $input->param('index');
57
	my $result= $input->param('result');
58
    my $result  = $input->param('result');
58
59
59
60
    my $dbh = C4::Context->dbh;
60
	my $dbh = C4::Context->dbh;
61
61
62
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
62
my ($template, $loggedinuser, $cookie)
63
        {   template_name   => "cataloguing/value_builder/marc21_field_007.tt",
63
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_field_007.tt",
64
            query           => $input,
64
			     query => $input,
65
            type            => "intranet",
65
			     type => "intranet",
66
            authnotrequired => 0,
66
			     authnotrequired => 0,
67
            flagsrequired   => { editcatalogue => '*' },
67
			     flagsrequired => {editcatalogue => '*'},
68
            debug           => 1,
68
			     debug => 1,
69
        }
69
			     });
70
    );
70
	$result = "ta" unless $result;
71
    $result = "ta" unless $result;
71
	my $f0 = substr($result,0,1);
72
    my $f0 = substr( $result, 0, 1 );
72
     my $f1 = substr($result,1,1);
73
    my $f1 = substr( $result, 1, 1 );
73
#added new parameters to allow for all material types
74
74
	my $f2 = substr($result,2,1);
75
    #added new parameters to allow for all material types
75
	my $f3 = substr($result,3,1);
76
    my $f2  = substr( $result, 2,  1 );
76
	my $f4 = substr($result,4,1);
77
    my $f3  = substr( $result, 3,  1 );
77
	my $f5 = substr($result,5,1);
78
    my $f4  = substr( $result, 4,  1 );
78
	my $f6 = substr($result,6,1);
79
    my $f5  = substr( $result, 5,  1 );
79
	my $f7 = substr($result,7,1);
80
    my $f6  = substr( $result, 6,  1 );
80
	my $f8 = substr($result,8,1);
81
    my $f7  = substr( $result, 7,  1 );
81
	my $f9 = substr($result,9,1);
82
    my $f8  = substr( $result, 8,  1 );
82
	my $f10 = substr($result,10,1);
83
    my $f9  = substr( $result, 9,  1 );
83
	my $f11 = substr($result,11,1);
84
    my $f10 = substr( $result, 10, 1 );
84
	my $f12 = substr($result,12,1);
85
    my $f11 = substr( $result, 11, 1 );
85
	my $f13 = substr($result,13,1);
86
    my $f12 = substr( $result, 12, 1 );
86
	my $f14 = substr($result,14,1);
87
    my $f13 = substr( $result, 13, 1 );
87
	my $f15 = substr($result,15,1);
88
    my $f14 = substr( $result, 14, 1 );
88
	my $f16 = substr($result,16,1);
89
    my $f15 = substr( $result, 15, 1 );
89
	my $f17 = substr($result,17,1);
90
    my $f16 = substr( $result, 16, 1 );
90
	my $f18 = substr($result,18,1);
91
    my $f17 = substr( $result, 17, 1 );
91
	my $f19 = substr($result,19,1);
92
    my $f18 = substr( $result, 18, 1 );
92
	my $f20 = substr($result,20,1);
93
    my $f19 = substr( $result, 19, 1 );
93
	my $f21 = substr($result,21,1);
94
    my $f20 = substr( $result, 20, 1 );
94
	my $f22 = substr($result,22,1);
95
    my $f21 = substr( $result, 21, 1 );
95
#FIXME:  There is probably a more-elegant way to do this!
96
    my $f22 = substr( $result, 22, 1 );
96
#FIXME:  Two of the material types treat position 06, 07, and 08 as a single
97
97
#three-char field.  This script works fine for creating values and sending them
98
    #FIXME:  There is probably a more-elegant way to do this!
98
#back to the MARC, but if there is already a value in the 007, it won't send
99
    #FIXME:  Two of the material types treat position 06, 07, and 08 as a single
99
#it properly to the value builder for those two instances.  Not sure how to solve.
100
    #three-char field.  This script works fine for creating values and sending them
100
	$template->param( index => $index,
101
    #back to the MARC, but if there is already a value in the 007, it won't send
101
			 f0 => $f0,
102
    #it properly to the value builder for those two instances.  Not sure how to solve.
102
			 "f0$f0" => $f0,
103
    $template->param(
103
			 f1 => $f1,
104
        index     => $index,
104
                         "f1$f1" => $f1,
105
        f0        => $f0,
105
			 f2 => $f2,
106
        "f0$f0"   => $f0,
106
			 "f2$f2" => $f2,
107
        f1        => $f1,
107
			 f3 => $f3,
108
        "f1$f1"   => $f1,
108
			 "f3$f3" => $f3,
109
        f2        => $f2,
109
			 f4 => $f4,
110
        "f2$f2"   => $f2,
110
			 "f4$f4" => $f4,
111
        f3        => $f3,
111
			 f5 => $f5,
112
        "f3$f3"   => $f3,
112
			 "f5$f5" => $f5,
113
        f4        => $f4,
113
			 f6 => $f6,
114
        "f4$f4"   => $f4,
114
			 "f6$f6" => $f6,
115
        f5        => $f5,
115
			 f7 => $f7,
116
        "f5$f5"   => $f5,
116
			 "f7$f7" => $f7,
117
        f6        => $f6,
117
			 f8 => $f8,
118
        "f6$f6"   => $f6,
118
			 "f8$f8" => $f8,
119
        f7        => $f7,
119
			 f9 => $f9,
120
        "f7$f7"   => $f7,
120
			 "f9$f9" => $f9,
121
        f8        => $f8,
121
			 f10 => $f10,
122
        "f8$f8"   => $f8,
122
			 "f10$f10" => $f10,
123
        f9        => $f9,
123
			 f11 => $f11,
124
        "f9$f9"   => $f9,
124
			 "f11$f11" => $f11,
125
        f10       => $f10,
125
			 f12 => $f12,
126
        "f10$f10" => $f10,
126
			 "f12$f12" => $f12,
127
        f11       => $f11,
127
			 f13 => $f13,
128
        "f11$f11" => $f11,
128
			 "f13$f13" => $f13,
129
        f12       => $f12,
129
			 f14 => $f14,
130
        "f12$f12" => $f12,
130
			 "f14$f14" => $f14,
131
        f13       => $f13,
131
			 f15 => $f15,
132
        "f13$f13" => $f13,
132
			 "f15$f15" => $f15,
133
        f14       => $f14,
133
			 f16 => $f16,
134
        "f14$f14" => $f14,
134
			 "f16$f16" => $f16,
135
        f15       => $f15,
135
			 f17 => $f17,
136
        "f15$f15" => $f15,
136
			 "f17$f17" => $f17,
137
        f16       => $f16,
137
			 f18 => $f18,
138
        "f16$f16" => $f16,
138
			 "f18$f18" => $f18,
139
        f17       => $f17,
139
			 f19 => $f19,
140
        "f17$f17" => $f17,
140
			 "f19$f19" => $f19,
141
        f18       => $f18,
141
			 f20 => $f20,
142
        "f18$f18" => $f18,
142
			 "f20$f20" => $f20,
143
        f19       => $f19,
143
			 f21 => $f21,
144
        "f19$f19" => $f19,
144
			 "f21$f21" => $f21,
145
        f20       => $f20,
145
			 f22 => $f22,
146
        "f20$f20" => $f20,
146
			 "f22$f22" => $f22,
147
        f21       => $f21,
147
					);
148
        "f21$f21" => $f21,
148
        output_html_with_http_headers $input, $cookie, $template->output;
149
        f22       => $f22,
150
        "f22$f22" => $f22,
151
    );
152
    output_html_with_http_headers $input, $cookie, $template->output;
149
}
153
}
(-)a/cataloguing/value_builder/marc21_leader.pl (-38 / +40 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 19-24 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
19
21
use strict;
20
use strict;
21
22
#use warnings; FIXME - Bug 2505
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
23
use C4::Auth;
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
Lines 28-36 use C4::Search; Link Here
28
use C4::Output;
28
use C4::Output;
29
29
30
sub plugin_javascript {
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
my $function_name= $field_number;
32
    my $function_name = $field_number;
33
my $res="
33
    my $res           = "
34
<script type=\"text/javascript\">
34
<script type=\"text/javascript\">
35
//<![CDATA[
35
//<![CDATA[
36
36
Lines 50-91 function Clic$function_name(i) { Link Here
50
</script>
50
</script>
51
";
51
";
52
52
53
return ($function_name,$res);
53
    return ( $function_name, $res );
54
}
54
}
55
sub plugin {
56
my ($input) = @_;
57
	my $index= $input->param('index');
58
	my $result= $input->param('result');
59
55
56
sub plugin {
57
    my ($input) = @_;
58
    my $index   = $input->param('index');
59
    my $result  = $input->param('result');
60
60
61
	my $dbh = C4::Context->dbh;
61
    my $dbh = C4::Context->dbh;
62
62
63
my ($template, $loggedinuser, $cookie)
63
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
64
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_leader.tt",
64
        {   template_name   => "cataloguing/value_builder/marc21_leader.tt",
65
			     query => $input,
65
            query           => $input,
66
			     type => "intranet",
66
            type            => "intranet",
67
			     authnotrequired => 0,
67
            authnotrequired => 0,
68
			     flagsrequired => {editcatalogue => '*'},
68
            flagsrequired   => { editcatalogue => '*' },
69
			     debug => 1,
69
            debug           => 1,
70
			     });
70
        }
71
	$result = "     nam a22     7a 4500" unless $result;
71
    );
72
	my $f5 = substr($result,5,1);
72
    $result = "     nam a22     7a 4500" unless $result;
73
	my $f6 = substr($result,6,1);
73
    my $f5    = substr( $result, 5,  1 );
74
	my $f7 = substr($result,7,1);
74
    my $f6    = substr( $result, 6,  1 );
75
	my $f8 = substr($result,8,1);
75
    my $f7    = substr( $result, 7,  1 );
76
	my $f17 = substr($result,17,1);
76
    my $f8    = substr( $result, 8,  1 );
77
	my $f18 = substr($result,18,1);
77
    my $f17   = substr( $result, 17, 1 );
78
	my $f19 = substr($result,19,1);
78
    my $f18   = substr( $result, 18, 1 );
79
	my $f2023 = substr($result,20,4);
79
    my $f19   = substr( $result, 19, 1 );
80
	$template->param(index => $index,
80
    my $f2023 = substr( $result, 20, 4 );
81
							"f5$f5" => 1,
81
    $template->param(
82
							"f6$f6" => 1,
82
        index     => $index,
83
							"f7$f7" => 1,
83
        "f5$f5"   => 1,
84
							"f8$f8" => 1,
84
        "f6$f6"   => 1,
85
							"f17$f17" => 1,
85
        "f7$f7"   => 1,
86
							"f18$f18" => 1,
86
        "f8$f8"   => 1,
87
							"f19$f19" => 1,
87
        "f17$f17" => 1,
88
							"f2023" => $f2023,
88
        "f18$f18" => 1,
89
					);
89
        "f19$f19" => 1,
90
        output_html_with_http_headers $input, $cookie, $template->output;
90
        "f2023"   => $f2023,
91
    );
92
    output_html_with_http_headers $input, $cookie, $template->output;
91
}
93
}
(-)a/cataloguing/value_builder/marc21_leader_authorities.pl (-36 / +38 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 19-24 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
19
21
use strict;
20
use strict;
21
22
#use warnings; FIXME - Bug 2505
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
23
use C4::Auth;
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
Lines 28-36 use C4::Search; Link Here
28
use C4::Output;
28
use C4::Output;
29
29
30
sub plugin_javascript {
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
my $function_name= $field_number;
32
    my $function_name = $field_number;
33
my $res="
33
    my $res           = "
34
<script type=\"text/javascript\">
34
<script type=\"text/javascript\">
35
//<![CDATA[
35
//<![CDATA[
36
36
Lines 50-89 function Clic$function_name(i) { Link Here
50
</script>
50
</script>
51
";
51
";
52
52
53
return ($function_name,$res);
53
    return ( $function_name, $res );
54
}
54
}
55
sub plugin {
56
my ($input) = @_;
57
	my $index= $input->param('index');
58
	my $result= $input->param('result');
59
55
56
sub plugin {
57
    my ($input) = @_;
58
    my $index   = $input->param('index');
59
    my $result  = $input->param('result');
60
60
61
	my $dbh = C4::Context->dbh;
61
    my $dbh = C4::Context->dbh;
62
62
63
my ($template, $loggedinuser, $cookie)
63
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
64
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_leader_authorities.tt",
64
        {   template_name   => "cataloguing/value_builder/marc21_leader_authorities.tt",
65
			     query => $input,
65
            query           => $input,
66
			     type => "intranet",
66
            type            => "intranet",
67
			     authnotrequired => 0,
67
            authnotrequired => 0,
68
			     flagsrequired => {editcatalogue => '*'},
68
            flagsrequired   => { editcatalogue => '*' },
69
			     debug => 1,
69
            debug           => 1,
70
			     });
70
        }
71
	$result = "     nz  a22     n  4500" unless $result;
71
    );
72
	my $f5 = substr($result,5,1);
72
    $result = "     nz  a22     n  4500" unless $result;
73
	my $f6 = substr($result,6,1);
73
    my $f5    = substr( $result, 5,  1 );
74
	my $f7 = substr($result,7,1);
74
    my $f6    = substr( $result, 6,  1 );
75
	my $f8 = substr($result,8,1);
75
    my $f7    = substr( $result, 7,  1 );
76
	my $f9 = substr($result,9,1);
76
    my $f8    = substr( $result, 8,  1 );
77
	my $f17 = substr($result,17,1);
77
    my $f9    = substr( $result, 9,  1 );
78
	my $f2023 = substr($result,20,4);
78
    my $f17   = substr( $result, 17, 1 );
79
	$template->param(index => $index,
79
    my $f2023 = substr( $result, 20, 4 );
80
							"f5$f5" => 1,
80
    $template->param(
81
							"f6$f6" => 1,
81
        index     => $index,
82
							"f7$f7" => 1,
82
        "f5$f5"   => 1,
83
							"f8$f8" => 1,
83
        "f6$f6"   => 1,
84
							"f9$f9" => 1,
84
        "f7$f7"   => 1,
85
							"f17$f17" => 1,
85
        "f8$f8"   => 1,
86
							"f2023" => $f2023,
86
        "f9$f9"   => 1,
87
					);
87
        "f17$f17" => 1,
88
        output_html_with_http_headers $input, $cookie, $template->output;
88
        "f2023"   => $f2023,
89
    );
90
    output_html_with_http_headers $input, $cookie, $template->output;
89
}
91
}
(-)a/cataloguing/value_builder/marc21_leader_book.pl (-38 / +40 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 19-24 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
19
21
use strict;
20
use strict;
21
22
#use warnings; FIXME - Bug 2505
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
23
use C4::Auth;
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
Lines 28-36 use C4::Search; Link Here
28
use C4::Output;
28
use C4::Output;
29
29
30
sub plugin_javascript {
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
my $function_name= $field_number;
32
    my $function_name = $field_number;
33
my $res="
33
    my $res           = "
34
<script type=\"text/javascript\">
34
<script type=\"text/javascript\">
35
//<![CDATA[
35
//<![CDATA[
36
36
Lines 43-85 function Clic$function_name(i) { Link Here
43
</script>
43
</script>
44
";
44
";
45
45
46
return ($function_name,$res);
46
    return ( $function_name, $res );
47
}
47
}
48
sub plugin {
49
my ($input) = @_;
50
	my $index= $input->param('index');
51
	my $result= $input->param('result');
52
48
49
sub plugin {
50
    my ($input) = @_;
51
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
53
53
54
	my $dbh = C4::Context->dbh;
54
    my $dbh = C4::Context->dbh;
55
55
56
my ($template, $loggedinuser, $cookie)
56
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
57
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_leader.tt",
57
        {   template_name   => "cataloguing/value_builder/marc21_leader.tt",
58
			     query => $input,
58
            query           => $input,
59
			     type => "intranet",
59
            type            => "intranet",
60
			     authnotrequired => 0,
60
            authnotrequired => 0,
61
			     flagsrequired => {editcatalogue => '*'},
61
            flagsrequired   => { editcatalogue => '*' },
62
			     debug => 1,
62
            debug           => 1,
63
			     });
63
        }
64
	$result = "     nam         7a      " unless $result;
64
    );
65
	my $f5 = substr($result,5,1);
65
    $result = "     nam         7a      " unless $result;
66
	my $f6 = substr($result,6,1);
66
    my $f5  = substr( $result, 5,  1 );
67
	my $f7 = substr($result,7,1);
67
    my $f6  = substr( $result, 6,  1 );
68
	my $f8 = substr($result,8,1);
68
    my $f7  = substr( $result, 7,  1 );
69
	my $f9 = substr($result,9,1);
69
    my $f8  = substr( $result, 8,  1 );
70
	my $f17 = substr($result,17,1);
70
    my $f9  = substr( $result, 9,  1 );
71
	my $f18 = substr($result,18,1);
71
    my $f17 = substr( $result, 17, 1 );
72
	my $f19 = substr($result,19,1);
72
    my $f18 = substr( $result, 18, 1 );
73
    my $f19 = substr( $result, 19, 1 );
73
74
74
	$template->param(index => $index,
75
    $template->param(
75
							"f5$f5" => 1,
76
        index     => $index,
76
							"f6$f6" => 1,
77
        "f5$f5"   => 1,
77
							"f7$f7" => 1,
78
        "f6$f6"   => 1,
78
							"f8$f8" => 1,
79
        "f7$f7"   => 1,
79
							"f9$f9" => 1,
80
        "f8$f8"   => 1,
80
							"f17$f17" => 1,
81
        "f9$f9"   => 1,
81
							"f18$f18" => 1,
82
        "f17$f17" => 1,
82
							"f19$f19" => 1,
83
        "f18$f18" => 1,
83
					);
84
        "f19$f19" => 1,
84
        output_html_with_http_headers $input, $cookie, $template->output;
85
    );
86
    output_html_with_http_headers $input, $cookie, $template->output;
85
}
87
}
(-)a/cataloguing/value_builder/marc21_leader_computerfile.pl (-38 / +40 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 19-24 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
19
21
use strict;
20
use strict;
21
22
#use warnings; FIXME - Bug 2505
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
23
use C4::Auth;
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
Lines 28-36 use C4::Search; Link Here
28
use C4::Output;
28
use C4::Output;
29
29
30
sub plugin_javascript {
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
my $function_name= $field_number;
32
    my $function_name = $field_number;
33
my $res="
33
    my $res           = "
34
<script type=\"text/javascript\">
34
<script type=\"text/javascript\">
35
//<![CDATA[
35
//<![CDATA[
36
36
Lines 43-85 function Clic$function_name(i) { Link Here
43
</script>
43
</script>
44
";
44
";
45
45
46
return ($function_name,$res);
46
    return ( $function_name, $res );
47
}
47
}
48
sub plugin {
49
my ($input) = @_;
50
	my $index= $input->param('index');
51
	my $result= $input->param('result');
52
48
49
sub plugin {
50
    my ($input) = @_;
51
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
53
53
54
	my $dbh = C4::Context->dbh;
54
    my $dbh = C4::Context->dbh;
55
55
56
my ($template, $loggedinuser, $cookie)
56
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
57
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_leader_computerfile.tt",
57
        {   template_name   => "cataloguing/value_builder/marc21_leader_computerfile.tt",
58
			     query => $input,
58
            query           => $input,
59
			     type => "intranet",
59
            type            => "intranet",
60
			     authnotrequired => 0,
60
            authnotrequired => 0,
61
			     flagsrequired => {editcatalogue => '*'},
61
            flagsrequired   => { editcatalogue => '*' },
62
			     debug => 1,
62
            debug           => 1,
63
			     });
63
        }
64
	$result = "     nmm         7a      " unless $result;
64
    );
65
	my $f5 = substr($result,5,1);
65
    $result = "     nmm         7a      " unless $result;
66
	my $f6 = substr($result,6,1);
66
    my $f5  = substr( $result, 5,  1 );
67
	my $f7 = substr($result,7,1);
67
    my $f6  = substr( $result, 6,  1 );
68
	my $f8 = substr($result,8,1);
68
    my $f7  = substr( $result, 7,  1 );
69
	my $f9 = substr($result,9,1);
69
    my $f8  = substr( $result, 8,  1 );
70
	my $f17 = substr($result,17,1);
70
    my $f9  = substr( $result, 9,  1 );
71
	my $f18 = substr($result,18,1);
71
    my $f17 = substr( $result, 17, 1 );
72
	my $f19 = substr($result,19,1);
72
    my $f18 = substr( $result, 18, 1 );
73
    my $f19 = substr( $result, 19, 1 );
73
74
74
	$template->param(index => $index,
75
    $template->param(
75
							"f5$f5" => 1,
76
        index     => $index,
76
							"f6$f6" => 1,
77
        "f5$f5"   => 1,
77
							"f7$f7" => 1,
78
        "f6$f6"   => 1,
78
							"f8$f8" => 1,
79
        "f7$f7"   => 1,
79
							"f9$f9" => 1,
80
        "f8$f8"   => 1,
80
							"f17$f17" => 1,
81
        "f9$f9"   => 1,
81
							"f18$f18" => 1,
82
        "f17$f17" => 1,
82
							"f19$f19" => 1,
83
        "f18$f18" => 1,
83
					);
84
        "f19$f19" => 1,
84
        output_html_with_http_headers $input, $cookie, $template->output;
85
    );
86
    output_html_with_http_headers $input, $cookie, $template->output;
85
}
87
}
(-)a/cataloguing/value_builder/marc21_leader_video.pl (-38 / +40 lines)
Lines 1-6 Link Here
1
#!/usr/bin/perl
1
#!/usr/bin/perl
2
2
3
4
# Copyright 2000-2002 Katipo Communications
3
# Copyright 2000-2002 Katipo Communications
5
#
4
#
6
# This file is part of Koha.
5
# This file is part of Koha.
Lines 19-24 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
19
21
use strict;
20
use strict;
21
22
#use warnings; FIXME - Bug 2505
22
#use warnings; FIXME - Bug 2505
23
use C4::Auth;
23
use C4::Auth;
24
use CGI qw ( -utf8 );
24
use CGI qw ( -utf8 );
Lines 28-36 use C4::Search; Link Here
28
use C4::Output;
28
use C4::Output;
29
29
30
sub plugin_javascript {
30
sub plugin_javascript {
31
my ($dbh,$record,$tagslib,$field_number,$tabloop) = @_;
31
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
32
my $function_name= $field_number;
32
    my $function_name = $field_number;
33
my $res="
33
    my $res           = "
34
<script type=\"text/javascript\">
34
<script type=\"text/javascript\">
35
//<![CDATA[
35
//<![CDATA[
36
36
Lines 43-85 function Clic$function_name(i) { Link Here
43
</script>
43
</script>
44
";
44
";
45
45
46
return ($function_name,$res);
46
    return ( $function_name, $res );
47
}
47
}
48
sub plugin {
49
my ($input) = @_;
50
	my $index= $input->param('index');
51
	my $result= $input->param('result');
52
48
49
sub plugin {
50
    my ($input) = @_;
51
    my $index   = $input->param('index');
52
    my $result  = $input->param('result');
53
53
54
	my $dbh = C4::Context->dbh;
54
    my $dbh = C4::Context->dbh;
55
55
56
my ($template, $loggedinuser, $cookie)
56
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
57
    = get_template_and_user({template_name => "cataloguing/value_builder/marc21_leader.tt",
57
        {   template_name   => "cataloguing/value_builder/marc21_leader.tt",
58
			     query => $input,
58
            query           => $input,
59
			     type => "intranet",
59
            type            => "intranet",
60
			     authnotrequired => 0,
60
            authnotrequired => 0,
61
			     flagsrequired => {editcatalogue => '*'},
61
            flagsrequired   => { editcatalogue => '*' },
62
			     debug => 1,
62
            debug           => 1,
63
			     });
63
        }
64
	$result = "     ngm         7a      " unless $result;
64
    );
65
	my $f5 = substr($result,5,1);
65
    $result = "     ngm         7a      " unless $result;
66
	my $f6 = substr($result,6,1);
66
    my $f5  = substr( $result, 5,  1 );
67
	my $f7 = substr($result,7,1);
67
    my $f6  = substr( $result, 6,  1 );
68
	my $f8 = substr($result,8,1);
68
    my $f7  = substr( $result, 7,  1 );
69
	my $f9 = substr($result,9,1);
69
    my $f8  = substr( $result, 8,  1 );
70
	my $f17 = substr($result,17,1);
70
    my $f9  = substr( $result, 9,  1 );
71
	my $f18 = substr($result,18,1);
71
    my $f17 = substr( $result, 17, 1 );
72
	my $f19 = substr($result,19,1);
72
    my $f18 = substr( $result, 18, 1 );
73
    my $f19 = substr( $result, 19, 1 );
73
74
74
	$template->param(index => $index,
75
    $template->param(
75
							"f5$f5" => 1,
76
        index     => $index,
76
							"f6$f6" => 1,
77
        "f5$f5"   => 1,
77
							"f7$f7" => 1,
78
        "f6$f6"   => 1,
78
							"f8$f8" => 1,
79
        "f7$f7"   => 1,
79
							"f9$f9" => 1,
80
        "f8$f8"   => 1,
80
							"f17$f17" => 1,
81
        "f9$f9"   => 1,
81
							"f18$f18" => 1,
82
        "f17$f17" => 1,
82
							"f19$f19" => 1,
83
        "f18$f18" => 1,
83
					);
84
        "f19$f19" => 1,
84
        output_html_with_http_headers $input, $cookie, $template->output;
85
    );
86
    output_html_with_http_headers $input, $cookie, $template->output;
85
}
87
}
(-)a/cataloguing/value_builder/marc21_linking_section.pl (-268 / +252 lines)
Lines 34-42 use C4::Branch; Link Here
34
use C4::ItemType;
34
use C4::ItemType;
35
35
36
sub plugin_javascript {
36
sub plugin_javascript {
37
  my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
37
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
38
  my $function_name = $field_number;
38
    my $function_name = $field_number;
39
     my $res           = "
39
    my $res           = "
40
  <script type='text/javascript'>
40
  <script type='text/javascript'>
41
             function Clic$function_name(i) {
41
             function Clic$function_name(i) {
42
                       defaultvalue=document.getElementById(\"$field_number\").value;
42
                       defaultvalue=document.getElementById(\"$field_number\").value;
Lines 60-334 sub plugin_javascript { Link Here
60
sub plugin {
60
sub plugin {
61
    my ($input)   = @_;
61
    my ($input)   = @_;
62
    my $dbh       = C4::Context->dbh;
62
    my $dbh       = C4::Context->dbh;
63
      my $query     = new CGI;
63
    my $query     = new CGI;
64
       my $op        = $query->param('op');
64
    my $op        = $query->param('op');
65
   my $type      = $query->param('type');
65
    my $type      = $query->param('type');
66
 my $startfrom = $query->param('startfrom');
66
    my $startfrom = $query->param('startfrom');
67
    $startfrom = 0 if ( !defined $startfrom );
67
    $startfrom = 0 if ( !defined $startfrom );
68
     my ( $template, $loggedinuser, $cookie );
68
    my ( $template, $loggedinuser, $cookie );
69
      my $resultsperpage;
69
    my $resultsperpage;
70
    my $searchdesc;
70
    my $searchdesc;
71
71
72
       if ( $op eq "fillinput" ) {
72
    if ( $op eq "fillinput" ) {
73
            my $biblionumber = $query->param('biblionumber');
73
        my $biblionumber = $query->param('biblionumber');
74
              my $index        = $query->param('index');
74
        my $index        = $query->param('index');
75
             my $marcrecord;
75
        my $marcrecord;
76
76
77
               # open template
77
        # open template
78
                ( $template, $loggedinuser, $cookie ) = get_template_and_user(
78
        ( $template, $loggedinuser, $cookie ) = get_template_and_user(
79
                 {
79
            {   template_name   => "cataloguing/value_builder/marc21_linking_section.tt",
80
                              template_name =>
80
                query           => $query,
81
                                 "cataloguing/value_builder/marc21_linking_section.tt",
81
                type            => "intranet",
82
                               query           => $query,
82
                authnotrequired => 0,
83
                             type            => "intranet",
83
                flagsrequired   => { editcatalogue => '*' },
84
                         authnotrequired => 0,
84
                debug           => 1,
85
                          flagsrequired   => { editcatalogue => '*' },
85
            }
86
                           debug           => 1,
86
        );
87
                  }
87
88
              );
88
        #get marc record
89
89
        $marcrecord = GetMarcBiblio($biblionumber);
90
            #get marc record
90
91
               $marcrecord = GetMarcBiblio($biblionumber);
91
        my $subfield_value_9 = $biblionumber;
92
92
        my $subfield_value_0 = $biblionumber;
93
           my $subfield_value_9 = $biblionumber;
93
94
          my $subfield_value_0 = $biblionumber;
94
        #my $subfield_value_0;
95
95
        #$subfield_value_0 = $marcrecord->field('001')->data
96
         #my $subfield_value_0;
96
        #  if $marcrecord->field('001');
97
         #$subfield_value_0 = $marcrecord->field('001')->data
97
        my $subfield_value_w;
98
           #  if $marcrecord->field('001');
98
        if ( $marcrecord->field('001') ) {
99
               my $subfield_value_w;
99
            $subfield_value_w = $marcrecord->field('001')->data;
100
          if ( $marcrecord->field('001') ) {
100
        } else {
101
                     $subfield_value_w = $marcrecord->field('001')->data;
101
            $subfield_value_w = $biblionumber;
102
           }
102
        }
103
              else {
103
104
                 $subfield_value_w = $biblionumber;
104
        my $subfield_value_a;
105
             }
105
        my $subfield_value_c;
106
106
        my $subfield_value_d;
107
             my $subfield_value_a;
107
        my $subfield_value_e;
108
          my $subfield_value_c;
108
109
          my $subfield_value_d;
109
        my $subfield_value_h;
110
          my $subfield_value_e;
110
111
111
        my $subfield_value_i;
112
         my $subfield_value_h;
112
113
113
        my $subfield_value_p;
114
         my $subfield_value_i;
114
115
115
        my $subfield_value_t;
116
         my $subfield_value_p;
116
        if ( $marcrecord->field('245') ) {
117
117
            $subfield_value_t = $marcrecord->title();
118
         my $subfield_value_t;
118
        }
119
          if ( $marcrecord->field('245') ) {
119
120
                     $subfield_value_t = $marcrecord->title();
120
        my $subfield_value_u;
121
              }
121
        my $subfield_value_v;
122
122
        my $subfield_value_x;
123
             my $subfield_value_u;
123
        my $subfield_value_y;
124
          my $subfield_value_v;
124
        my $subfield_value_z;
125
          my $subfield_value_x;
125
126
          my $subfield_value_y;
126
        $subfield_value_x = $marcrecord->field('022')->subfield("a")
127
          my $subfield_value_z;
127
          if ( $marcrecord->field('022') );
128
128
        $subfield_value_z = $marcrecord->field('020')->subfield("a")
129
         $subfield_value_x = $marcrecord->field('022')->subfield("a")
129
          if ( $marcrecord->field('020') );
130
             if ( $marcrecord->field('022') );
130
131
            $subfield_value_z = $marcrecord->field('020')->subfield("a")
131
        # escape the 's
132
             if ( $marcrecord->field('020') );
132
        $subfield_value_9 =~ s/'/\\'/g;
133
133
        $subfield_value_0 =~ s/'/\\'/g;
134
           # escape the 's
134
        $subfield_value_a =~ s/'/\\'/g;
135
                $subfield_value_9 =~ s/'/\\'/g;
135
        $subfield_value_c =~ s/'/\\'/g;
136
                $subfield_value_0 =~ s/'/\\'/g;
136
        $subfield_value_d =~ s/'/\\'/g;
137
                $subfield_value_a =~ s/'/\\'/g;
137
        $subfield_value_e =~ s/'/\\'/g;
138
                $subfield_value_c =~ s/'/\\'/g;
138
        $subfield_value_h =~ s/'/\\'/g;
139
                $subfield_value_d =~ s/'/\\'/g;
139
        $subfield_value_i =~ s/'/\\'/g;
140
                $subfield_value_e =~ s/'/\\'/g;
140
        $subfield_value_p =~ s/'/\\'/g;
141
                $subfield_value_h =~ s/'/\\'/g;
141
        $subfield_value_t =~ s/'/\\'/g;
142
                $subfield_value_i =~ s/'/\\'/g;
142
        $subfield_value_u =~ s/'/\\'/g;
143
                $subfield_value_p =~ s/'/\\'/g;
143
        $subfield_value_v =~ s/'/\\'/g;
144
                $subfield_value_t =~ s/'/\\'/g;
144
        $subfield_value_w =~ s/'/\\'/g;
145
                $subfield_value_u =~ s/'/\\'/g;
145
        $subfield_value_x =~ s/'/\\'/g;
146
                $subfield_value_v =~ s/'/\\'/g;
146
        $subfield_value_y =~ s/'/\\'/g;
147
                $subfield_value_w =~ s/'/\\'/g;
147
        $subfield_value_z =~ s/'/\\'/g;
148
                $subfield_value_x =~ s/'/\\'/g;
148
        $template->param(
149
                $subfield_value_y =~ s/'/\\'/g;
149
            fillinput        => 1,
150
                $subfield_value_z =~ s/'/\\'/g;
150
            index            => $query->param('index') . "",
151
                $template->param(
151
            biblionumber     => $biblionumber ? $biblionumber : "",
152
                      fillinput        => 1,
152
            subfield_value_9 => "$subfield_value_9",
153
                 index            => $query->param('index') . "",
153
            subfield_value_0 => "$subfield_value_0",
154
                       biblionumber     => $biblionumber ? $biblionumber : "",
154
            subfield_value_a => "$subfield_value_a",
155
                        subfield_value_9 => "$subfield_value_9",
155
            subfield_value_c => "$subfield_value_c",
156
                       subfield_value_0 => "$subfield_value_0",
156
            subfield_value_d => "$subfield_value_d",
157
                       subfield_value_a => "$subfield_value_a",
157
            subfield_value_e => "$subfield_value_e",
158
                       subfield_value_c => "$subfield_value_c",
158
            subfield_value_h => "$subfield_value_h",
159
                       subfield_value_d => "$subfield_value_d",
159
            subfield_value_i => "$subfield_value_i",
160
                       subfield_value_e => "$subfield_value_e",
160
            subfield_value_p => "$subfield_value_p",
161
                       subfield_value_h => "$subfield_value_h",
161
            subfield_value_t => "$subfield_value_t",
162
                       subfield_value_i => "$subfield_value_i",
162
            subfield_value_u => "$subfield_value_u",
163
                       subfield_value_p => "$subfield_value_p",
163
            subfield_value_v => "$subfield_value_v",
164
                       subfield_value_t => "$subfield_value_t",
164
            subfield_value_w => "$subfield_value_w",
165
                       subfield_value_u => "$subfield_value_u",
165
            subfield_value_x => "$subfield_value_x",
166
                       subfield_value_v => "$subfield_value_v",
166
            subfield_value_y => "$subfield_value_y",
167
                       subfield_value_w => "$subfield_value_w",
167
            subfield_value_z => "$subfield_value_z",
168
                       subfield_value_x => "$subfield_value_x",
168
        );
169
                       subfield_value_y => "$subfield_value_y",
170
                       subfield_value_z => "$subfield_value_z",
171
               );
172
###############################################################
169
###############################################################
173
     }
170
    } elsif ( $op eq "do_search" ) {
174
      elsif ( $op eq "do_search" ) {
171
        my $search         = $query->param('search');
175
         my $search         = $query->param('search');
172
        my $itype          = $query->param('itype');
176
          my $itype          = $query->param('itype');
173
        my $startfrom      = $query->param('startfrom');
177
           my $startfrom      = $query->param('startfrom');
174
        my $resultsperpage = $query->param('resultsperpage') || 20;
178
               my $resultsperpage = $query->param('resultsperpage') || 20;
175
        my $orderby;
179
            my $orderby;
176
        my $QParser;
180
            my $QParser;
177
        $QParser = C4::Context->queryparser if ( C4::Context->preference('UseQueryParser') );
181
            $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));
178
        my $op;
182
            my $op;
179
183
            if ($QParser) {
180
        if ($QParser) {
184
                $op = '&&';
181
            $op = '&&';
185
            } else {
182
        } else {
186
                $op = 'and';
183
            $op = 'and';
184
        }
185
        $search = 'kw:' . $search . " $op mc-itemtype:" . $itype if $itype;
186
        my ( $errors, $results, $total_hits ) = SimpleSearch( $search, $startfrom * $resultsperpage, $resultsperpage );
187
        if ( defined $errors ) {
188
            $results = [];
189
        }
190
        my $total = @{$results};
191
192
        #        warn " biblio count : ".$total;
193
194
        ( $template, $loggedinuser, $cookie ) = get_template_and_user(
195
            {   template_name   => "cataloguing/value_builder/marc21_linking_section.tt",
196
                query           => $query,
197
                type            => 'intranet',
198
                authnotrequired => 0,
199
                debug           => 1,
187
            }
200
            }
188
           $search = 'kw:' . $search . " $op mc-itemtype:" . $itype if $itype;
201
        );
189
               my ( $errors, $results, $total_hits ) =
202
190
                  SimpleSearch( $search, $startfrom * $resultsperpage,
203
        # multi page display gestion
191
                 $resultsperpage );
204
        my $displaynext = 0;
192
             if ( defined $errors ) {
205
        my $displayprev = $startfrom;
193
                       $results = [];
206
194
         }
207
        if ( ( $total_hits - ( ( $startfrom + 1 ) * ($resultsperpage) ) ) > 0 ) {
195
              my $total = @{$results};
208
            $displaynext = 1;
196
209
        }
197
              #        warn " biblio count : ".$total;
210
        my @arrayresults;
198
211
        my @field_data = ($search);
199
              ( $template, $loggedinuser, $cookie ) = get_template_and_user(
212
        for ( my $i = 0 ; $i < $resultsperpage ; $i++ ) {
200
                 {
213
            my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] );
201
                              template_name =>
214
            my $rechash = TransformMarcToKoha( $dbh, $record );
202
                                 "cataloguing/value_builder/marc21_linking_section.tt",
215
            my $pos;
203
                               query           => $query,
216
            my $countitems = $rechash->{itembumber} ? 1 : 0;
204
                             type            => 'intranet',
217
            while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
205
                         authnotrequired => 0,
218
                $countitems += 1;
206
                          debug           => 1,
219
                $pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
207
                  }
220
            }
208
              );
221
            $rechash->{totitem} = $countitems;
209
222
            my @holdingbranches = split /\|/, $rechash->{holdingbranch};
210
            # multi page display gestion
223
            my @itemcallnumbers = split /\|/, $rechash->{itemcallnumber};
211
           my $displaynext = 0;
224
            my $CN;
212
           my $displayprev = $startfrom;
225
            for ( my $i = 0 ; $i < @holdingbranches ; $i++ ) {
213
226
                $CN .= $holdingbranches[$i] . " ( " . $itemcallnumbers[$i] . " ) |";
214
         if ( ( $total_hits - ( ( $startfrom + 1 ) * ($resultsperpage) ) ) > 0 )
227
            }
215
                {
228
            $CN =~ s/ \|$//;
216
                      $displaynext = 1;
229
            $rechash->{CN} = $CN;
217
              }
230
            push @arrayresults, $rechash;
218
              my @arrayresults;
231
        }
219
              my @field_data = ($search);
232
220
            for ( my $i = 0 ; $i < $resultsperpage ; $i++ ) {
233
        #         for(my $i = 0 ; $i <= $#marclist ; $i++)
221
                  my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] );
234
        #         {
222
                  my $rechash = TransformMarcToKoha( $dbh, $record );
235
        #             push @field_data, { term => "marclist", val=>$marclist[$i] };
223
                    my $pos;
236
        #             push @field_data, { term => "and_or", val=>$and_or[$i] };
224
                       my $countitems = $rechash->{itembumber} ? 1 : 0;
237
        #             push @field_data, { term => "excluding", val=>$excluding[$i] };
225
                      while ( index( $rechash->{itemnumber}, '|', $pos ) > 0 ) {
238
        #             push @field_data, { term => "operator", val=>$operator[$i] };
226
                             $countitems += 1;
239
        #             push @field_data, { term => "value", val=>$value[$i] };
227
                              $pos = index( $rechash->{itemnumber}, '|', $pos ) + 1;
240
        #         }
228
                 }
241
229
                      $rechash->{totitem} = $countitems;
242
        my @numbers = ();
230
                     my @holdingbranches = split /\|/, $rechash->{holdingbranch};
243
231
                   my @itemcallnumbers = split /\|/, $rechash->{itemcallnumber};
244
        if ( $total > $resultsperpage ) {
232
                  my $CN;
245
            for ( my $i = 1 ; $i < $total / $resultsperpage + 1 ; $i++ ) {
233
                        for ( my $i = 0 ; $i < @holdingbranches ; $i++ ) {
246
                if ( $i < 16 ) {
234
                             $CN .=
247
                    my $highlight = 0;
235
                           $holdingbranches[$i] . " ( " . $itemcallnumbers[$i] . " ) |";
248
                    ( $startfrom == ( $i - 1 ) ) && ( $highlight = 1 );
236
                        }
249
                    push @numbers,
237
                      $CN =~ s/ \|$//;
250
                      { number     => $i,
238
                       $rechash->{CN} = $CN;
251
                        highlight  => $highlight,
239
                  push @arrayresults, $rechash;
252
                        searchdata => \@field_data,
240
          }
253
                        startfrom  => ( $i - 1 )
241
254
                      };
242
   #         for(my $i = 0 ; $i <= $#marclist ; $i++)
255
                }
243
   #         {
256
            }
244
   #             push @field_data, { term => "marclist", val=>$marclist[$i] };
257
        }
245
   #             push @field_data, { term => "and_or", val=>$and_or[$i] };
258
246
   #             push @field_data, { term => "excluding", val=>$excluding[$i] };
259
        my $from = $startfrom * $resultsperpage + 1;
247
   #             push @field_data, { term => "operator", val=>$operator[$i] };
260
        my $to;
248
   #             push @field_data, { term => "value", val=>$value[$i] };
261
249
   #         }
262
        if ( $total_hits < $from + $resultsperpage ) {
250
263
            $to = $total_hits;
251
             my @numbers = ();
264
        } else {
252
265
            $to = $from + $resultsperpage;
253
             if ( $total > $resultsperpage ) {
266
        }
254
                      for ( my $i = 1 ; $i < $total / $resultsperpage + 1 ; $i++ ) {
267
        my $defaultview = 'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView');
255
                         if ( $i < 16 ) {
268
256
                                       my $highlight = 0;
269
        #         my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search";
257
                                     ( $startfrom == ( $i - 1 ) ) && ( $highlight = 1 );
270
        #           foreach my $sort (@sort_by){
258
                                    push @numbers,
271
        #             $link.="&sort_by=".$sort."&";
259
                                   {
272
        #           }
260
                                            number     => $i,
273
        #           $template->param(
261
                                              highlight  => $highlight,
274
        #             pagination_bar => pagination_bar(
262
                                              searchdata => \@field_data,
275
        #                     $link,
263
                                            startfrom  => ( $i - 1 )
276
        #                     getnbpages($hits, $results_per_page),
264
                                         };
277
        #                     $page,
265
                           }
278
        #                     'page'
266
                      }
279
        #             ),
267
              }
280
        #           );
268
281
        $template->param(
269
             my $from = $startfrom * $resultsperpage + 1;
282
            result         => \@arrayresults,
270
           my $to;
283
            index          => $query->param('index') . "",
271
284
            startfrom      => $startfrom,
272
               if ( $total_hits < $from + $resultsperpage ) {
285
            displaynext    => $displaynext,
273
                 $to = $total_hits;
286
            displayprev    => $displayprev,
274
             }
287
            resultsperpage => $resultsperpage,
275
              else {
288
            orderby        => $orderby,
276
                 $to = $from + $resultsperpage;
289
            startfromnext  => $startfrom + 1,
277
         }
290
            startfromprev  => $startfrom - 1,
278
              my $defaultview =
291
            searchdata     => \@field_data,
279
                'BiblioDefaultView' . C4::Context->preference('BiblioDefaultView');
292
            total          => $total_hits,
280
293
            from           => $from,
281
#         my $link="/cgi-bin/koha/cataloguing/value_builder/unimarc4XX.pl?op=do_search&q=$search_desc&resultsperpage=$resultsperpage&startfrom=$startfrom&search=$search";
294
            to             => $to,
282
#           foreach my $sort (@sort_by){
295
            numbers        => \@numbers,
283
#             $link.="&sort_by=".$sort."&";
296
            search         => $search,
284
#           }
297
            $defaultview   => 1,
285
#           $template->param(
298
            Search         => 0
286
#             pagination_bar => pagination_bar(
299
        );
287
#                     $link,
300
288
#                     getnbpages($hits, $results_per_page),
301
    } else {
289
#                     $page,
302
        ( $template, $loggedinuser, $cookie ) = get_template_and_user(
290
#                     'page'
303
            {   template_name   => "cataloguing/value_builder/marc21_linking_section.tt",
291
#             ),
304
                query           => $query,
292
#           );
305
                type            => "intranet",
293
          $template->param(
306
                authnotrequired => 0,
294
                      result         => \@arrayresults,
307
            }
295
                      index          => $query->param('index') . "",
308
        );
296
                 startfrom      => $startfrom,
309
297
                  displaynext    => $displaynext,
310
        my @itemtypes = C4::ItemType->all;
298
                        displayprev    => $displayprev,
299
                        resultsperpage => $resultsperpage,
300
                     orderby        => $orderby,
301
                    startfromnext  => $startfrom + 1,
302
                      startfromprev  => $startfrom - 1,
303
                      searchdata     => \@field_data,
304
                        total          => $total_hits,
305
                 from           => $from,
306
                       to             => $to,
307
                 numbers        => \@numbers,
308
                   search         => $search,
309
                     $defaultview   => 1,
310
                   Search         => 0
311
            );
312
311
312
        $template->param(
313
            itypeloop => \@itemtypes,
314
            index     => $query->param('index'),
315
            Search    => 1,
316
        );
313
    }
317
    }
314
      else {
318
    output_html_with_http_headers $query, $cookie, $template->output;
315
         ( $template, $loggedinuser, $cookie ) = get_template_and_user(
316
                 {
317
                              template_name =>
318
                                 "cataloguing/value_builder/marc21_linking_section.tt",
319
                               query           => $query,
320
                             type            => "intranet",
321
                         authnotrequired => 0,
322
                  }
323
              );
324
325
            my @itemtypes = C4::ItemType->all;
326
327
            $template->param(
328
                        itypeloop    => \@itemtypes,
329
                        index        => $query->param('index'),
330
                        Search       => 1,
331
            );
332
     }
333
      output_html_with_http_headers $query, $cookie, $template->output;
334
}
319
}
335
- 

Return to bug 13437