Lines 26-40
use C4::Output qw( output_html_with_http_headers );
Link Here
|
26 |
use C4::Reserves qw( AddReserve ModReserve ); |
26 |
use C4::Reserves qw( AddReserve ModReserve ); |
27 |
use C4::Context; |
27 |
use C4::Context; |
28 |
use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing ); |
28 |
use C4::Serials qw( delroutingmember getroutinglist GetSubscription GetSerials check_routing ); |
29 |
use URI::Escape; |
|
|
30 |
|
29 |
|
31 |
use Koha::Biblios; |
30 |
use Koha::Biblios; |
32 |
use Koha::Libraries; |
31 |
use Koha::Libraries; |
33 |
use Koha::Patrons; |
32 |
use Koha::Patrons; |
|
|
33 |
use Koha::Serial::Items; |
34 |
|
34 |
|
35 |
my $query = CGI->new; |
35 |
my $query = CGI->new; |
36 |
my $subscriptionid = $query->param('subscriptionid'); |
36 |
my $subscriptionid = $query->param('subscriptionid'); |
37 |
my $issue = $query->param('issue'); |
37 |
my $serialid = $query->param('serialid'); |
38 |
my $routingid; |
38 |
my $routingid; |
39 |
my $ok = $query->param('ok'); |
39 |
my $ok = $query->param('ok'); |
40 |
my $edit = $query->param('edit'); |
40 |
my $edit = $query->param('edit'); |
Lines 52-57
if($edit){
Link Here
|
52 |
print $query->redirect("routing.pl?subscriptionid=$subscriptionid"); |
52 |
print $query->redirect("routing.pl?subscriptionid=$subscriptionid"); |
53 |
} |
53 |
} |
54 |
|
54 |
|
|
|
55 |
my $serial = Koha::Serials->find($serialid); |
55 |
my @routinglist = getroutinglist($subscriptionid); |
56 |
my @routinglist = getroutinglist($subscriptionid); |
56 |
my $subs = GetSubscription($subscriptionid); |
57 |
my $subs = GetSubscription($subscriptionid); |
57 |
my ($tmp ,@serials) = GetSerials($subscriptionid); |
58 |
my ($tmp ,@serials) = GetSerials($subscriptionid); |
Lines 63-74
if($ok){
Link Here
|
63 |
my $biblionumber = $subs->{'bibnum'}; |
64 |
my $biblionumber = $subs->{'bibnum'}; |
64 |
|
65 |
|
65 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
66 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
66 |
my $items = $biblio->items->search_ordered; |
67 |
my $branchcode = $subs->{branchcode}; |
67 |
my $branch = |
68 |
my $serialitem = Koha::Serial::Items->search( { serialid => $serialid } )->next; |
68 |
$items->count |
69 |
if ( $serialitem ) { |
69 |
? $items->next->holding_branch->branchcode |
70 |
my $item = Koha::Items->find($serialitem->itemnumber); |
70 |
: $subs->{branchcode}; |
71 |
$branchcode = $item->holdingbranch || $branchcode; |
71 |
$library = Koha::Libraries->find($branch); |
72 |
} |
|
|
73 |
$library = Koha::Libraries->find($branchcode); |
72 |
|
74 |
|
73 |
if (C4::Context->preference('RoutingListAddReserves')){ |
75 |
if (C4::Context->preference('RoutingListAddReserves')){ |
74 |
# get existing reserves ..... |
76 |
# get existing reserves ..... |
Lines 90-101
if($ok){
Link Here
|
90 |
rank => $routing->{ranking}, |
92 |
rank => $routing->{ranking}, |
91 |
biblionumber => $biblionumber, |
93 |
biblionumber => $biblionumber, |
92 |
borrowernumber => $routing->{borrowernumber}, |
94 |
borrowernumber => $routing->{borrowernumber}, |
93 |
branchcode => $branch |
95 |
branchcode => $branchcode, |
94 |
}); |
96 |
}); |
95 |
} else { |
97 |
} else { |
96 |
AddReserve( |
98 |
AddReserve( |
97 |
{ |
99 |
{ |
98 |
branchcode => $branch, |
100 |
branchcode => $branchcode, |
99 |
borrowernumber => $routing->{borrowernumber}, |
101 |
borrowernumber => $routing->{borrowernumber}, |
100 |
biblionumber => $biblionumber, |
102 |
biblionumber => $biblionumber, |
101 |
priority => $routing->{ranking}, |
103 |
priority => $routing->{ranking}, |
Lines 136-143
$routingnotes =~ s/\n/\<br \/\>/g;
Link Here
|
136 |
|
138 |
|
137 |
$template->param( |
139 |
$template->param( |
138 |
title => $subs->{'bibliotitle'}, |
140 |
title => $subs->{'bibliotitle'}, |
139 |
issue => $issue, |
141 |
serial => $serial, |
140 |
issue_escaped => URI::Escape::uri_escape_utf8($issue), |
|
|
141 |
subscriptionid => $subscriptionid, |
142 |
subscriptionid => $subscriptionid, |
142 |
memberloop => $memberloop, |
143 |
memberloop => $memberloop, |
143 |
routingnotes => $routingnotes, |
144 |
routingnotes => $routingnotes, |