|
Lines 9-14
use C4::Biblio;
Link Here
|
| 9 |
use C4::Service; |
9 |
use C4::Service; |
| 10 |
use Koha::Database; |
10 |
use Koha::Database; |
| 11 |
use Koha::Libraries; |
11 |
use Koha::Libraries; |
|
|
12 |
use Koha::AuthorisedValues; |
| 12 |
|
13 |
|
| 13 |
my ( $query, $response ) = C4::Service->init( editcatalogue => 'edit_catalogue' ); |
14 |
my ( $query, $response ) = C4::Service->init( editcatalogue => 'edit_catalogue' ); |
| 14 |
|
15 |
|
|
Lines 52-69
foreach my $class_source (sort keys %$class_sources) {
Link Here
|
| 52 |
} |
53 |
} |
| 53 |
|
54 |
|
| 54 |
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
55 |
my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; |
| 55 |
my $results; |
56 |
my $results = Koha::AuthorisedValues->search({ branchcode => $branch_limit },{ order_by => "lib" }); |
| 56 |
if( $branch_limit ) { |
|
|
| 57 |
$results = $schema->resultset( "AuthorisedValue" )->search( |
| 58 |
{ "authorised_values_branches.branchcode" => { "=", [ $branch_limit, undef ] } }, |
| 59 |
{ join => "authorised_values_branches", order_by => "lib" } ); |
| 60 |
} else { |
| 61 |
$results = $schema->resultset( "AuthorisedValue" )->search( |
| 62 |
undef, |
| 63 |
{ order_by => "lib" } ); |
| 64 |
} |
| 65 |
|
57 |
|
| 66 |
foreach my $result ( $results->all ) { |
58 |
while ( my $result = $results->next ) { |
| 67 |
$authorised_values->{$result->category} ||= []; |
59 |
$authorised_values->{$result->category} ||= []; |
| 68 |
push @{ $authorised_values->{$result->category} }, { value => $result->authorised_value, lib => $result->lib }; |
60 |
push @{ $authorised_values->{$result->category} }, { value => $result->authorised_value, lib => $result->lib }; |
| 69 |
} |
61 |
} |
| 70 |
- |
|
|