|
Lines 21-28
use Modern::Perl;
Link Here
|
| 21 |
|
21 |
|
| 22 |
use CGI qw ( -utf8 ); |
22 |
use CGI qw ( -utf8 ); |
| 23 |
|
23 |
|
|
|
24 |
use Koha::Biblios; |
| 25 |
use Koha::Bookings; |
| 26 |
use Koha::Patrons; |
| 27 |
use Koha::Items; |
| 28 |
use Koha::CirculationRules; |
| 29 |
|
| 24 |
use C4::Output qw( output_html_with_http_headers ); |
30 |
use C4::Output qw( output_html_with_http_headers ); |
| 25 |
use C4::Auth qw( get_template_and_user ); |
31 |
use C4::Auth qw( get_template_and_user ); |
| 26 |
|
32 |
|
| 27 |
my $input = CGI->new; |
33 |
my $input = CGI->new; |
| 28 |
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( |
34 |
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user( |
|
Lines 35-41
my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
Link Here
|
| 35 |
); |
41 |
); |
| 36 |
|
42 |
|
| 37 |
my $biblionumber = $input->param('biblionumber'); |
43 |
my $biblionumber = $input->param('biblionumber'); |
| 38 |
my $biblio = Koha::Biblios->find($biblionumber); |
44 |
my $biblio = Koha::Biblios->find( { biblionumber => $biblionumber } ); |
|
|
45 |
my $booking = Koha::Bookings->find( { biblio_id => $biblionumber } ); |
| 46 |
if ($booking) { |
| 47 |
|
| 48 |
my $patron = Koha::Patrons->find( { borrowernumber => $booking->patron_id } ); |
| 49 |
my $item = Koha::Items->find( { itemnumber => $booking->item_id } ); |
| 50 |
|
| 51 |
my $rule = Koha::CirculationRules->get_effective_rule( |
| 52 |
{ |
| 53 |
categorycode => $patron->categorycode, |
| 54 |
itemtype => $item->effective_itemtype, |
| 55 |
branchcode => $item->homebranch, |
| 56 |
rule_name => 'bookings_period_length', |
| 57 |
|
| 58 |
} |
| 59 |
); |
| 60 |
|
| 61 |
my $bookings_period_length = $rule ? $rule->rule_value : 0; |
| 62 |
|
| 63 |
$template->param( |
| 64 |
bookings_period_length => $bookings_period_length, |
| 65 |
); |
| 66 |
} |
| 39 |
|
67 |
|
| 40 |
$template->param( |
68 |
$template->param( |
| 41 |
biblionumber => $biblionumber, |
69 |
biblionumber => $biblionumber, |