|
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-208
HideCols($authcat, @hide_cols);
Link Here
|
| 192 |
} |
191 |
} |
| 193 |
# ------------------------------------------------------------ |
192 |
# ------------------------------------------------------------ |
| 194 |
if ( $authcat =~ m/^Asort/ ) { |
193 |
if ( $authcat =~ m/^Asort/ ) { |
| 195 |
my $categoryauthvalues = C4::Acquisition->GetAuthValuesForCategory($authcat); |
194 |
my $sth = Koha::AuthorisedValue->GetAuthValues($authcat,$dbh); |
| 196 |
|
195 |
|
| 197 |
if ( $categoryauthvalues->rows > 0 ) { |
196 |
if ( $sth->rows > 0 ) { |
| 198 |
for ( my $i = 0 ; $i < $categoryauthvalues->rows ; $i++ ) { |
197 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
| 199 |
my $results = $categoryauthvalues->fetchrow_hashref; |
198 |
my $results = $sth->fetchrow_hashref; |
| 200 |
push @authvals, $results->{authorised_value}; |
199 |
push @authvals, $results->{authorised_value}; |
| 201 |
$labels{ $results->{authorised_value} } = $results->{lib}; |
200 |
$labels{ $results->{authorised_value} } = $results->{lib}; |
| 202 |
} |
201 |
} |
| 203 |
} |
202 |
} |
| 204 |
$categoryauthvalues->finish; |
203 |
$sth->finish; |
| 205 |
@authvals = sort { $a <=> $b } @authvals; |
204 |
@authvals = sort { $a <=> $b } @authvals; |
| 206 |
} |
205 |
} |
| 207 |
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_enddate ) { |
206 |
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_enddate ) { |
| 208 |
|
207 |
|
|
Lines 228-264
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_endda
Link Here
|
| 228 |
} |
227 |
} |
| 229 |
|
228 |
|
| 230 |
elsif ( $authcat eq 'ITEMTYPES' ) { |
229 |
elsif ( $authcat eq 'ITEMTYPES' ) { |
| 231 |
my $query = qq| SELECT itemtype, description FROM itemtypes |; |
|
|
| 232 |
my $sth = $dbh->prepare($query); |
| 233 |
$sth->execute( ); |
| 234 |
|
230 |
|
| 235 |
if ( $sth->rows > 0 ) { |
231 |
my $sth = Koha::ItemType->GetItemTypes($dbh); |
| 236 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
232 |
if ( $sth->rows > 0 ) { |
|
|
233 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
| 237 |
my $results = $sth->fetchrow_hashref; |
234 |
my $results = $sth->fetchrow_hashref; |
| 238 |
push @authvals, $results->{itemtype}; |
235 |
push @authvals, $results->{itemtype}; |
| 239 |
$labels{ $results->{itemtype} } = $results->{description}; |
236 |
$labels{ $results->{itemtype} } = $results->{description}; |
| 240 |
} |
237 |
} |
| 241 |
} |
238 |
} |
| 242 |
$sth->finish; |
239 |
$sth->finish; |
| 243 |
|
240 |
|
| 244 |
} elsif ( $authcat eq 'BRANCHES' ) { |
241 |
} elsif ( $authcat eq 'BRANCHES' ) { |
| 245 |
|
242 |
|
| 246 |
my $query = qq| SELECT branchcode, branchname FROM branches |; |
243 |
my $sth = Koha::Libraries->GetBranches($dbh); |
| 247 |
my $sth = $dbh->prepare($query); |
|
|
| 248 |
$sth->execute(); |
| 249 |
|
244 |
|
| 250 |
if ( $sth->rows > 0 ) { |
245 |
if ( $sth->rows > 0 ) { |
| 251 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
246 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
| 252 |
my $results = $sth->fetchrow_hashref; |
247 |
my $results = $sth->fetchrow_hashref; |
| 253 |
push @authvals, $results->{branchcode}; |
248 |
push @authvals, $results->{branchcode}; |
| 254 |
$labels{ $results->{branchcode} } = $results->{branchname}; |
249 |
$labels{ $results->{branchcode} } = $results->{branchname}; |
| 255 |
} |
250 |
} |
| 256 |
} |
251 |
} |
| 257 |
$sth->finish; |
|
|
| 258 |
} elsif ($authcat) { |
252 |
} elsif ($authcat) { |
| 259 |
my $query = qq{ SELECT * FROM authorised_values WHERE category=? order by lib }; |
253 |
|
| 260 |
my $sth = $dbh->prepare($query); |
254 |
my $sth = Koha::AuthorisedValue->GetAuthValues($authcat,$dbh); |
| 261 |
$sth->execute($authcat); |
|
|
| 262 |
if ( $sth->rows > 0 ) { |
255 |
if ( $sth->rows > 0 ) { |
| 263 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
256 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
| 264 |
my $results = $sth->fetchrow_hashref; |
257 |
my $results = $sth->fetchrow_hashref; |
| 265 |
- |
|
|