Lines 110-117
my $op = $input->param("op");
Link Here
|
110 |
my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}->{'borrowernumber'}:'' ); |
110 |
my $budgets_ref = GetBudgetHierarchy( $budget_period_id, $show_mine?$template->{VARS}->{'USER_INFO'}->{'branchcode'}:'', $show_mine?$template->{VARS}->{'USER_INFO'}->{'borrowernumber'}:'' ); |
111 |
|
111 |
|
112 |
# build categories list |
112 |
# build categories list |
113 |
my $sth = $dbh->prepare("select distinct category from authorised_values where category like 'A%' "); |
113 |
my $sth = Koha::AuthorisedValue->GetDistinctCat($dbh); |
114 |
$sth->execute; |
|
|
115 |
|
114 |
|
116 |
# the list |
115 |
# the list |
117 |
my @category_list; |
116 |
my @category_list; |
Lines 192-205
HideCols($authcat, @hide_cols);
Link Here
|
192 |
} |
191 |
} |
193 |
# ------------------------------------------------------------ |
192 |
# ------------------------------------------------------------ |
194 |
if ( $authcat =~ m/^Asort/ ) { |
193 |
if ( $authcat =~ m/^Asort/ ) { |
195 |
my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib }; |
194 |
my $sth = Koha::AuthorisedValue->GetAuthValues($authcat,$dbh); |
196 |
my $sth = $dbh->prepare($query); |
195 |
|
197 |
$sth->execute($authcat ); |
|
|
198 |
if ( $sth->rows > 0 ) { |
196 |
if ( $sth->rows > 0 ) { |
199 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
197 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
200 |
my $results = $sth->fetchrow_hashref; |
198 |
my $results = $sth->fetchrow_hashref; |
201 |
push @authvals, $results->{authorised_value}; |
199 |
push @authvals, $results->{authorised_value}; |
202 |
$labels{ $results->{authorised_value} } = $results->{lib}; |
200 |
$labels{ $results->{authorised_value} } = $results->{lib}; |
203 |
} |
201 |
} |
204 |
} |
202 |
} |
205 |
$sth->finish; |
203 |
$sth->finish; |
Lines 229-265
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_endda
Link Here
|
229 |
} |
227 |
} |
230 |
|
228 |
|
231 |
elsif ( $authcat eq 'ITEMTYPES' ) { |
229 |
elsif ( $authcat eq 'ITEMTYPES' ) { |
232 |
my $query = qq| SELECT itemtype, description FROM itemtypes |; |
|
|
233 |
my $sth = $dbh->prepare($query); |
234 |
$sth->execute( ); |
235 |
|
230 |
|
236 |
if ( $sth->rows > 0 ) { |
231 |
my $sth = Koha::ItemType->GetItemTypes($dbh); |
237 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
232 |
if ( $sth->rows > 0 ) { |
|
|
233 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
238 |
my $results = $sth->fetchrow_hashref; |
234 |
my $results = $sth->fetchrow_hashref; |
239 |
push @authvals, $results->{itemtype}; |
235 |
push @authvals, $results->{itemtype}; |
240 |
$labels{ $results->{itemtype} } = $results->{description}; |
236 |
$labels{ $results->{itemtype} } = $results->{description}; |
241 |
} |
237 |
} |
242 |
} |
238 |
} |
243 |
$sth->finish; |
239 |
$sth->finish; |
244 |
|
240 |
|
245 |
} elsif ( $authcat eq 'BRANCHES' ) { |
241 |
} elsif ( $authcat eq 'BRANCHES' ) { |
246 |
|
242 |
|
247 |
my $query = qq| SELECT branchcode, branchname FROM branches |; |
243 |
my $sth = Koha::Libraries->GetBranches($dbh); |
248 |
my $sth = $dbh->prepare($query); |
|
|
249 |
$sth->execute(); |
250 |
|
244 |
|
251 |
if ( $sth->rows > 0 ) { |
245 |
if ( $sth->rows > 0 ) { |
252 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
246 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
253 |
my $results = $sth->fetchrow_hashref; |
247 |
my $results = $sth->fetchrow_hashref; |
254 |
push @authvals, $results->{branchcode}; |
248 |
push @authvals, $results->{branchcode}; |
255 |
$labels{ $results->{branchcode} } = $results->{branchname}; |
249 |
$labels{ $results->{branchcode} } = $results->{branchname}; |
256 |
} |
250 |
} |
257 |
} |
251 |
} |
258 |
$sth->finish; |
|
|
259 |
} elsif ($authcat) { |
252 |
} elsif ($authcat) { |
260 |
my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib }; |
253 |
|
261 |
my $sth = $dbh->prepare($query); |
254 |
my $sth = Koha::AuthorisedValue->GetAuthValues($authcat,$dbh); |
262 |
$sth->execute($authcat); |
|
|
263 |
if ( $sth->rows > 0 ) { |
255 |
if ( $sth->rows > 0 ) { |
264 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
256 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
265 |
my $results = $sth->fetchrow_hashref; |
257 |
my $results = $sth->fetchrow_hashref; |