Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 36 lines (28 sloc) 0.738 kb
#!/usr/bin/env perl
use Koha;
use CGI;
use C4::Auth;
use C4::Items qw();
my $query = CGI->new;
my ($template, $agent_id, $cookie) = get_template_and_user(
{
template_name => 'catalogue/detail.tmpl',
query => $query,
type => 'intranet',
authnotrequired => 0,
flagsrequired => { borrow => '*' },
}
);
my $itemnumber = $query->param('itemnumber');
my $item = C4::Items::GetItem($itemnumber);
my $agent = C4::Members::GetMember($agent_id);
die if !$item;
if ($query->param('action') ~~ 'pause') {
C4::Items::PauseOffer($agent, $item);
}
else {
C4::Items::UnpauseOffer($item);
}
my $target = $ENV{HTTP_REFERER};
print $query->redirect($target);
exit;
Jump to Line
Something went wrong with that request. Please try again.