Lines 122-135
sub UpdateTransportCostMatrix {
Link Here
|
122 |
|
122 |
|
123 |
=head2 GetHoldsQueueItems |
123 |
=head2 GetHoldsQueueItems |
124 |
|
124 |
|
125 |
GetHoldsQueueItems($branch); |
125 |
GetHoldsQueueItems({ branchlimit => $branch, itemtypeslimit => $itype, ccodeslimit => $ccode, locationslimit => $location ); |
126 |
|
126 |
|
127 |
Returns hold queue for a holding branch. If branch is omitted, then whole queue is returned |
127 |
Returns hold queue for a holding branch. If branch is omitted, then whole queue is returned |
128 |
|
128 |
|
129 |
=cut |
129 |
=cut |
130 |
|
130 |
|
131 |
sub GetHoldsQueueItems { |
131 |
sub GetHoldsQueueItems { |
132 |
my ($branchlimit) = @_; |
132 |
my $params = shift; |
133 |
my $dbh = C4::Context->dbh; |
133 |
my $dbh = C4::Context->dbh; |
134 |
|
134 |
|
135 |
my @bind_params = (); |
135 |
my @bind_params = (); |
Lines 143-152
sub GetHoldsQueueItems {
Link Here
|
143 |
JOIN biblio USING (biblionumber) |
143 |
JOIN biblio USING (biblionumber) |
144 |
LEFT JOIN biblioitems USING (biblionumber) |
144 |
LEFT JOIN biblioitems USING (biblionumber) |
145 |
LEFT JOIN items USING ( itemnumber) |
145 |
LEFT JOIN items USING ( itemnumber) |
|
|
146 |
WHERE 1=1 |
146 |
/; |
147 |
/; |
147 |
if ($branchlimit) { |
148 |
if ($params->{branchlimit}) { |
148 |
$query .=" WHERE tmp_holdsqueue.holdingbranch = ?"; |
149 |
$query .="AND tmp_holdsqueue.holdingbranch = ? "; |
149 |
push @bind_params, $branchlimit; |
150 |
push @bind_params, $params->{branchlimit}; |
|
|
151 |
} |
152 |
if( $params->{itemtypeslimit} ) { |
153 |
$query .=" AND items.itype = ? "; |
154 |
push @bind_params, $params->{itemtypeslimit}; |
155 |
} |
156 |
if( $params->{ccodeslimit} ) { |
157 |
$query .=" AND items.ccode = ? "; |
158 |
push @bind_params, $params->{ccodeslimit}; |
159 |
} |
160 |
if( $params->{locationslimit} ) { |
161 |
$query .=" AND items.location = ? "; |
162 |
push @bind_params, $params->{locationslimit}; |
150 |
} |
163 |
} |
151 |
$query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate"; |
164 |
$query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate"; |
152 |
my $sth = $dbh->prepare($query); |
165 |
my $sth = $dbh->prepare($query); |