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 $op = $query->param('op') || q{}; |
39 |
my $op = $query->param('op') || q{}; |
40 |
my $dbh = C4::Context->dbh; |
40 |
my $dbh = C4::Context->dbh; |
Lines 50-55
if($op eq 'cud-edit'){
Link Here
|
50 |
print $query->redirect("routing.pl?subscriptionid=$subscriptionid"); |
50 |
print $query->redirect("routing.pl?subscriptionid=$subscriptionid"); |
51 |
} |
51 |
} |
52 |
|
52 |
|
|
|
53 |
my $serial = Koha::Serials->find($serialid); |
53 |
my @routinglist = getroutinglist($subscriptionid); |
54 |
my @routinglist = getroutinglist($subscriptionid); |
54 |
my $subs = GetSubscription($subscriptionid); |
55 |
my $subs = GetSubscription($subscriptionid); |
55 |
my ($tmp ,@serials) = GetSerials($subscriptionid); |
56 |
my ($tmp ,@serials) = GetSerials($subscriptionid); |
Lines 61-72
if($op eq 'cud-save_and_preview'){
Link Here
|
61 |
my $biblionumber = $subs->{'bibnum'}; |
62 |
my $biblionumber = $subs->{'bibnum'}; |
62 |
|
63 |
|
63 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
64 |
my $biblio = Koha::Biblios->find( $biblionumber ); |
64 |
my $items = $biblio->items->search_ordered; |
65 |
my $branchcode = $subs->{branchcode}; |
65 |
my $branch = |
66 |
my $serialitem = Koha::Serial::Items->search( { serialid => $serialid } )->next; |
66 |
$items->count |
67 |
if ( $serialitem ) { |
67 |
? $items->next->holding_branch->branchcode |
68 |
my $item = Koha::Items->find($serialitem->itemnumber); |
68 |
: $subs->{branchcode}; |
69 |
$branchcode = $item->holdingbranch || $branchcode; |
69 |
$library = Koha::Libraries->find($branch); |
70 |
} |
|
|
71 |
$library = Koha::Libraries->find($branchcode); |
70 |
|
72 |
|
71 |
if (C4::Context->preference('RoutingListAddReserves')){ |
73 |
if (C4::Context->preference('RoutingListAddReserves')){ |
72 |
|
74 |
|
Lines 82-93
if($op eq 'cud-save_and_preview'){
Link Here
|
82 |
rank => $routing->{ranking}, |
84 |
rank => $routing->{ranking}, |
83 |
biblionumber => $biblionumber, |
85 |
biblionumber => $biblionumber, |
84 |
borrowernumber => $routing->{borrowernumber}, |
86 |
borrowernumber => $routing->{borrowernumber}, |
85 |
branchcode => $branch |
87 |
branchcode => $branchcode, |
86 |
}); |
88 |
}); |
87 |
} else { |
89 |
} else { |
88 |
AddReserve( |
90 |
AddReserve( |
89 |
{ |
91 |
{ |
90 |
branchcode => $branch, |
92 |
branchcode => $branchcode, |
91 |
borrowernumber => $routing->{borrowernumber}, |
93 |
borrowernumber => $routing->{borrowernumber}, |
92 |
biblionumber => $biblionumber, |
94 |
biblionumber => $biblionumber, |
93 |
priority => $routing->{ranking}, |
95 |
priority => $routing->{ranking}, |
Lines 134-141
$routingnotes =~ s/\n/\<br \/\>/g;
Link Here
|
134 |
|
136 |
|
135 |
$template->param( |
137 |
$template->param( |
136 |
title => $subs->{'bibliotitle'}, |
138 |
title => $subs->{'bibliotitle'}, |
137 |
issue => $issue, |
139 |
serial => $serial, |
138 |
issue_escaped => URI::Escape::uri_escape_utf8($issue), |
|
|
139 |
subscriptionid => $subscriptionid, |
140 |
subscriptionid => $subscriptionid, |
140 |
memberloop => $memberloop, |
141 |
memberloop => $memberloop, |
141 |
routingnotes => $routingnotes, |
142 |
routingnotes => $routingnotes, |