Bug 7684: multiple fixes for inventory
[koha.git] / tools / ajax-inventory.pl
1 #!/usr/bin/perl
2 #
3
4 use Modern::Perl;
5
6 use CGI;
7 use JSON;
8
9 use C4::Auth;
10 use C4::Circulation qw/CanBookBeRenewed/;
11 use C4::Context;
12 use C4::Koha qw/getitemtypeimagelocation/;
13 use C4::Reserves qw/CheckReserves/;
14 use C4::Utils::DataTables;
15 use C4::Output;
16 use C4::Biblio;
17 use C4::Items;
18 use C4::Dates qw/format_date format_date_in_iso/;
19 use C4::Koha;
20 use C4::Branch;    # GetBranches
21 use C4::Reports::Guided;    #_get_column_defs
22 use C4::Charset;
23 use List::MoreUtils qw /none/;
24
25
26 my $input = new CGI;
27
28 # Authentication
29 my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
30 exit unless ($status eq "ok");
31
32
33 my $seen = $input->param('seen');
34 my @seent = split(/\|/, $seen);
35
36 # mark seen if applicable (ie: coming form mark seen checkboxes)
37 foreach ( @seent ) {
38     /SEEN-(.+)/ and &ModDateLastSeen($1);
39 }
40
41
42 print $input->header('application/json');
43