|
Lines 110-123
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 = Koha::AuthorisedValue->GetDistinctCat($dbh); |
113 |
my @DistinctAuthValues = Koha::AuthorisedValue->GetDistinctCat(); |
| 114 |
|
114 |
|
| 115 |
# the list |
115 |
# the list |
| 116 |
my @category_list; |
116 |
my @category_list; |
| 117 |
|
117 |
|
| 118 |
# a hash, to check that some hardcoded categories exist. |
118 |
# a hash, to check that some hardcoded categories exist. |
| 119 |
my %categories; |
119 |
my %categories; |
| 120 |
while ( my ($category) = $sth->fetchrow_array ) { |
120 |
while ( my ($category) = each @DistinctAuthValues ) { |
| 121 |
push( @category_list, $category ); |
121 |
push( @category_list, $category ); |
| 122 |
$categories{$category} = 1; |
122 |
$categories{$category} = 1; |
| 123 |
} |
123 |
} |
|
Lines 191-206
HideCols($authcat, @hide_cols);
Link Here
|
| 191 |
} |
191 |
} |
| 192 |
# ------------------------------------------------------------ |
192 |
# ------------------------------------------------------------ |
| 193 |
if ( $authcat =~ m/^Asort/ ) { |
193 |
if ( $authcat =~ m/^Asort/ ) { |
| 194 |
my $sth = Koha::AuthorisedValue->GetAuthValues($authcat,$dbh); |
194 |
my @AuthValues = Koha::AuthorisedValue->GetAuthValues($authcat); |
| 195 |
|
195 |
if ( @AuthValues > 0 ) { |
| 196 |
if ( $sth->rows > 0 ) { |
196 |
while ( my ($AuthValue) = each @AuthValues) { |
| 197 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
197 |
my $results = $AuthValue; |
| 198 |
my $results = $sth->fetchrow_hashref; |
198 |
push @authvals, $results->{authorised_value}; |
| 199 |
push @authvals, $results->{authorised_value}; |
199 |
$labels{ $results->{authorised_value} } = $results->{lib}; |
| 200 |
$labels{ $results->{authorised_value} } = $results->{lib}; |
|
|
| 201 |
} |
200 |
} |
| 202 |
} |
201 |
} |
| 203 |
$sth->finish; |
|
|
| 204 |
@authvals = sort { $a <=> $b } @authvals; |
202 |
@authvals = sort { $a <=> $b } @authvals; |
| 205 |
} |
203 |
} |
| 206 |
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_enddate ) { |
204 |
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_enddate ) { |
|
Lines 227-242
elsif ( $authcat eq 'MONTHS' && $budget_period_startdate && $budget_period_endda
Link Here
|
| 227 |
} |
225 |
} |
| 228 |
|
226 |
|
| 229 |
elsif ( $authcat eq 'ITEMTYPES' ) { |
227 |
elsif ( $authcat eq 'ITEMTYPES' ) { |
| 230 |
|
228 |
my $sth = Koha::ItemType->GetItemTypes($dbh); |
| 231 |
my $sth = Koha::ItemType->GetItemTypes($dbh); |
229 |
|
| 232 |
if ( $sth->rows > 0 ) { |
230 |
if ( $sth->rows > 0 ) { |
| 233 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
231 |
for ( my $i = 0 ; $i < $sth->rows ; $i++ ) { |
| 234 |
my $results = $sth->fetchrow_hashref; |
232 |
my $results = $sth->fetchrow_hashref; |
| 235 |
push @authvals, $results->{itemtype}; |
233 |
push @authvals, $results->{itemtype}; |
| 236 |
$labels{ $results->{itemtype} } = $results->{description}; |
234 |
$labels{ $results->{itemtype} } = $results->{description}; |
| 237 |
} |
235 |
} |
| 238 |
} |
236 |
} |
| 239 |
$sth->finish; |
|
|
| 240 |
|
237 |
|
| 241 |
} elsif ( $authcat eq 'BRANCHES' ) { |
238 |
} elsif ( $authcat eq 'BRANCHES' ) { |
| 242 |
|
239 |
|