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

(-)a/C4/HoldsQueue.pm (-3 / +4 lines)
Lines 48-55 BEGIN { Link Here
48
     );
48
     );
49
}
49
}
50
50
51
# XXX This is not safe in a persistant environment
52
my $dbh   = C4::Context->dbh;
53
51
54
=head1 FUNCTIONS
52
=head1 FUNCTIONS
55
53
Lines 62-67 Returns Transport Cost Matrix as a hashref <to branch code> => <from branch code Link Here
62
=cut
60
=cut
63
61
64
sub TransportCostMatrix {
62
sub TransportCostMatrix {
63
    my $dbh   = C4::Context->dbh;
65
    my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} });
64
    my $transport_costs = $dbh->selectall_arrayref("SELECT * FROM transport_cost",{ Slice => {} });
66
65
67
    my %transport_cost_matrix;
66
    my %transport_cost_matrix;
Lines 86-91 Records: { frombranch => <code>, tobranch => <code>, cost => <figure>, disable_t Link Here
86
85
87
sub UpdateTransportCostMatrix {
86
sub UpdateTransportCostMatrix {
88
    my ($records) = @_;
87
    my ($records) = @_;
88
    my $dbh   = C4::Context->dbh;
89
89
90
    my $sth = $dbh->prepare("INSERT INTO transport_cost (frombranch, tobranch, cost, disable_transfer) VALUES (?, ?, ?, ?)");
90
    my $sth = $dbh->prepare("INSERT INTO transport_cost (frombranch, tobranch, cost, disable_transfer) VALUES (?, ?, ?, ?)");
91
91
Lines 116-121 Returns hold queue for a holding branch. If branch is omitted, then whole queue Link Here
116
116
117
sub GetHoldsQueueItems {
117
sub GetHoldsQueueItems {
118
    my ($branchlimit) = @_;
118
    my ($branchlimit) = @_;
119
    my $dbh   = C4::Context->dbh;
119
120
120
    my @bind_params = ();
121
    my @bind_params = ();
121
    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber
122
    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber
Lines 154-159 Top level function that turns reserves into tmp_holdsqueue and hold_fill_targets Link Here
154
=cut
155
=cut
155
156
156
sub CreateQueue {
157
sub CreateQueue {
158
    my $dbh   = C4::Context->dbh;
157
159
158
    $dbh->do("DELETE FROM tmp_holdsqueue");  # clear the old table for new info
160
    $dbh->do("DELETE FROM tmp_holdsqueue");  # clear the old table for new info
159
    $dbh->do("DELETE FROM hold_fill_targets");
161
    $dbh->do("DELETE FROM hold_fill_targets");
160
- 

Return to bug 8890