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

(-)a/serials/routing-preview.pl (-5 / +7 lines)
Lines 66-77 if($op eq 'cud-save_and_preview'){ Link Here
66
        $items->count
66
        $items->count
67
      ? $items->next->holding_branch->branchcode
67
      ? $items->next->holding_branch->branchcode
68
      : $subs->{branchcode};
68
      : $subs->{branchcode};
69
69
    $library = Koha::Libraries->find($branch);
70
    $library = Koha::Libraries->find($branch);
70
71
71
	if (C4::Context->preference('RoutingListAddReserves')){
72
    if ( C4::Context->preference('RoutingListAddReserves') && $serialitem ) {
72
73
73
		my $notes;
74
        my $notes;
74
		my $title = $subs->{'bibliotitle'};
75
        my $title = $subs->{'bibliotitle'};
75
        for my $routing ( @routinglist ) {
76
        for my $routing ( @routinglist ) {
76
            my $sth = $dbh->prepare('SELECT * FROM reserves WHERE biblionumber = ? AND borrowernumber = ? LIMIT 1');
77
            my $sth = $dbh->prepare('SELECT * FROM reserves WHERE biblionumber = ? AND borrowernumber = ? LIMIT 1');
77
            $sth->execute($biblionumber,$routing->{borrowernumber});
78
            $sth->execute($biblionumber,$routing->{borrowernumber});
Lines 81-86 if($op eq 'cud-save_and_preview'){ Link Here
81
                ModReserve({
82
                ModReserve({
82
                    rank           => $routing->{ranking},
83
                    rank           => $routing->{ranking},
83
                    biblionumber   => $biblionumber,
84
                    biblionumber   => $biblionumber,
85
                    itemnumber     => $serialitem->itemnumber,
84
                    borrowernumber => $routing->{borrowernumber},
86
                    borrowernumber => $routing->{borrowernumber},
85
                    branchcode     => $branch
87
                    branchcode     => $branch
86
                });
88
                });
Lines 90-103 if($op eq 'cud-save_and_preview'){ Link Here
90
                        branchcode     => $branch,
92
                        branchcode     => $branch,
91
                        borrowernumber => $routing->{borrowernumber},
93
                        borrowernumber => $routing->{borrowernumber},
92
                        biblionumber   => $biblionumber,
94
                        biblionumber   => $biblionumber,
95
                        itemnumber     => $serialitem->itemnumber,
93
                        priority       => $routing->{ranking},
96
                        priority       => $routing->{ranking},
94
                        notes          => $notes,
97
                        notes          => $notes,
95
                        title          => $title,
98
                        title          => $title,
96
                    }
99
                    }
97
                );
100
                );
101
            }
98
        }
102
        }
99
    }
103
    }
100
	}
101
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid&print_routing_list_issue=" . $query->param('issue_escaped'));
104
    print $query->redirect("/cgi-bin/koha/serials/subscription-detail.pl?subscriptionid=$subscriptionid&print_routing_list_issue=" . $query->param('issue_escaped'));
102
    exit;
105
    exit;
103
} elsif ( $op eq 'print' ) {
106
} elsif ( $op eq 'print' ) {
104
- 

Return to bug 2894