Bug 3955: Fixes leading space error in search.
[koha.git] / cataloguing / merge_ajax.pl
blobdb4a430839ce4353cf324040000a5c5d689658ac
1 #!/usr/bin/perl
3 use strict;
5 # standard or CPAN modules used
6 use IO::File;
7 use CGI;
8 use CGI::Session;
9 use C4::Context;
10 use C4::Biblio;
11 use C4::Auth qw/check_cookie_auth/;
12 use C4::UploadedFile;
13 use JSON;
14 use CGI::Cookie; # need to check cookies before
15 # having CGI parse the POST request
17 my %cookies = fetch CGI::Cookie;
18 my ($auth_status, $sessionID) = check_cookie_auth($cookies{'CGISESSID'}->value, { editcatalogue => '1' });
19 if ($auth_status ne "ok") {
20 my $reply = CGI->new("");
21 print $reply->header(-type => 'text/html');
22 exit 0;
25 my $reply = new CGI;
26 my $framework = $reply->param('frameworkcode');
27 my $tagslib = GetMarcStructure(1, $framework);
28 print $reply->header(-type => 'text/html');
29 print encode_json $tagslib;