Bug 19074: Fix category display in Batch patron modification.
[koha.git] / authorities / merge_ajax.pl
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 use CGI qw ( -utf8 );
7 use CGI::Cookie; # need to check cookies before CGI parses the POST request
8 use JSON;
9
10 use C4::Context;
11 use C4::Auth qw/check_cookie_auth/;
12 use C4::AuthoritiesMarc;
13
14 my %cookies = CGI::Cookie->fetch;
15 my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' });
16 my $reply = CGI->new;
17 if ($auth_status ne "ok") {
18     print $reply->header(-type => 'text/html');
19     exit 0;
20 }
21
22 my $framework = $reply->param('frameworkcode');
23 my $tagslib = GetTagsLabels(1, $framework);
24 print $reply->header(-type => 'text/html');
25 print encode_json $tagslib;