Bug 17755: (followup) Override ->search to allow filtering by branchcode
[koha.git] / authorities / merge_ajax.pl
blob39796b0be9093888c33ba3159eba729c42d17d00
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 use CGI qw ( -utf8 );
7 use CGI::Cookie; # need to check cookies before CGI parses the POST request
8 use JSON;
10 use C4::Context;
11 use C4::Auth qw/check_cookie_auth/;
12 use C4::AuthoritiesMarc;
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;
22 my $framework = $reply->param('frameworkcode');
23 my $tagslib = GetTagsLabels(1, $framework);
24 print $reply->header(-type => 'text/html');
25 print encode_json $tagslib;