Lines 114-127
sub UpdateTransportCostMatrix {
Link Here
|
114 |
|
114 |
|
115 |
=head2 GetHoldsQueueItems |
115 |
=head2 GetHoldsQueueItems |
116 |
|
116 |
|
117 |
GetHoldsQueueItems($branch); |
117 |
GetHoldsQueueItems({ branchlimit => $branch, itemtypeslimit => $itype, ccodeslimit => $ccode, locationslimit => $location ); |
118 |
|
118 |
|
119 |
Returns hold queue for a holding branch. If branch is omitted, then whole queue is returned |
119 |
Returns hold queue for a holding branch. If branch is omitted, then whole queue is returned |
120 |
|
120 |
|
121 |
=cut |
121 |
=cut |
122 |
|
122 |
|
123 |
sub GetHoldsQueueItems { |
123 |
sub GetHoldsQueueItems { |
124 |
my ($branchlimit) = @_; |
124 |
my $params = shift; |
125 |
my $dbh = C4::Context->dbh; |
125 |
my $dbh = C4::Context->dbh; |
126 |
|
126 |
|
127 |
my @bind_params = (); |
127 |
my @bind_params = (); |
Lines 135-144
sub GetHoldsQueueItems {
Link Here
|
135 |
JOIN biblio USING (biblionumber) |
135 |
JOIN biblio USING (biblionumber) |
136 |
LEFT JOIN biblioitems USING (biblionumber) |
136 |
LEFT JOIN biblioitems USING (biblionumber) |
137 |
LEFT JOIN items USING ( itemnumber) |
137 |
LEFT JOIN items USING ( itemnumber) |
|
|
138 |
WHERE 1=1 |
138 |
/; |
139 |
/; |
139 |
if ($branchlimit) { |
140 |
if ($params->{branchlimit}) { |
140 |
$query .=" WHERE tmp_holdsqueue.holdingbranch = ?"; |
141 |
$query .="AND tmp_holdsqueue.holdingbranch = ? "; |
141 |
push @bind_params, $branchlimit; |
142 |
push @bind_params, $params->{branchlimit}; |
|
|
143 |
} |
144 |
if( $params->{itemtypeslimit} ) { |
145 |
$query .=" AND items.itype = ? "; |
146 |
push @bind_params, $params->{itemtypeslimit}; |
147 |
} |
148 |
if( $params->{ccodeslimit} ) { |
149 |
$query .=" AND items.ccode = ? "; |
150 |
push @bind_params, $params->{ccodeslimit}; |
151 |
} |
152 |
if( $params->{locationslimit} ) { |
153 |
$query .=" AND items.location = ? "; |
154 |
push @bind_params, $params->{locationslimit}; |
142 |
} |
155 |
} |
143 |
$query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate"; |
156 |
$query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate"; |
144 |
my $sth = $dbh->prepare($query); |
157 |
my $sth = $dbh->prepare($query); |