Bug 16807 - Use Koha::BiblioFrameworks instead of GetFrameWorkLoop
[koha.git] / cataloguing / merge_ajax.pl
1 #!/usr/bin/perl
2
3 use Modern::Perl;
4
5 use CGI qw ( -utf8 );
6 use CGI::Cookie; # need to check cookies before CGI parses the POST request
7 use JSON;
8
9 use C4::Context;
10 use C4::Biblio;
11 use C4::Auth qw/check_cookie_auth/;
12
13 my %cookies = CGI::Cookie->fetch;
14 my ( $auth_status, $sessionID ) = check_cookie_auth(
15     $cookies{'CGISESSID'}->value, { editcatalogue => 'edit_catalogue' },
16 );
17 my $reply = CGI->new;
18 if ($auth_status ne "ok") {
19     print $reply->header(-type => 'text/html');
20     exit 0;
21
22
23 my $framework = $reply->param('frameworkcode');
24 my $tagslib = GetMarcStructure(1, $framework);
25 print $reply->header(-type => 'text/html');
26 print encode_json $tagslib;