View | Details | Raw Unified | Return to bug 37961
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-2 / +2 lines)
Lines 490-496 Link Here
490
                $("input:checked").each(function() {
490
                $("input:checked").each(function() {
491
                    param += "|" + $(this).attr('name');
491
                    param += "|" + $(this).attr('name');
492
                });
492
                });
493
                $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param });
493
                $.post('/cgi-bin/koha/tools/ajax-inventory.pl', { seen: param, op: 'cud-seen', csrf_token: $('meta[name="csrf-token"]').attr("content") });
494
                inventorydt.fnPageChange( 'next' );
494
                inventorydt.fnPageChange( 'next' );
495
                return false;
495
                return false;
496
            });
496
            });
Lines 503-509 Link Here
503
                $.ajax({
503
                $.ajax({
504
                  type: 'POST',
504
                  type: 'POST',
505
                  url: '/cgi-bin/koha/tools/ajax-inventory.pl',
505
                  url: '/cgi-bin/koha/tools/ajax-inventory.pl',
506
                  data: { seen: param},
506
                  data: { seen: param, op: 'cud-seen', csrf_token: $('meta[name="csrf-token"]').attr("content") },
507
                  async: false
507
                  async: false
508
                });
508
                });
509
                document.location.href = '/cgi-bin/koha/tools/inventory.pl';
509
                document.location.href = '/cgi-bin/koha/tools/inventory.pl';
(-)a/tools/ajax-inventory.pl (-6 / +8 lines)
Lines 11-23 my $input = CGI->new; Link Here
11
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
11
my ($status, $cookie, $sessionId) = C4::Auth::check_api_auth($input, { tools => 'inventory' });
12
exit unless ($status eq "ok");
12
exit unless ($status eq "ok");
13
13
14
my $op = $input->param('op') // q{};
14
15
15
my $seen = $input->param('seen');
16
if ( $op eq 'cud-seen' ) {
16
my @seent = split(/\|/, $seen);
17
    my $seen  = $input->param('seen');
18
    my @seent = split( /\|/, $seen );
17
19
18
# mark seen if applicable (ie: coming form mark seen checkboxes)
20
    # mark seen if applicable (ie: coming form mark seen checkboxes)
19
foreach ( @seent ) {
21
    foreach (@seent) {
20
    /SEEN-(.+)/ and &ModDateLastSeen($1);
22
        /SEEN-(.+)/ and &ModDateLastSeen($1);
23
    }
21
}
24
}
22
25
23
print $input->header('application/json');
26
print $input->header('application/json');
24
- 

Return to bug 37961