use strict;
-require Exporter;
+
use C4::AuthoritiesMarc;
use C4::Auth;
use C4::Context;
# use C4::Catalogue;
our ($tagslib);
-=item find_value
-
- ($indicators, $value) = find_value($tag, $subfield, $record,$encoding);
-
-Find the given $subfield in the given $tag in the given
-MARC::Record $record. If the subfield is found, returns
-the (indicators, value) pair; otherwise, (undef, undef) is
-returned.
-
-=cut
-
-sub find_value {
- my ($tagfield,$insubfield,$record,$encoding) = @_;
- my @result;
- my $indicator;
- if ($tagfield <10) {
- if ($record->field($tagfield)) {
- push @result, $record->field($tagfield)->data();
- } else {
- push @result,"";
- }
- } else {
- foreach my $field ($record->field($tagfield)) {
- my @subfields = $field->subfields();
- foreach my $subfield (@subfields) {
- if (@$subfield[0] eq $insubfield) {
- push @result,@$subfield[1];
- $indicator = $field->indicator(1).$field->indicator(2);
- }
- }
- }
- }
- return($indicator,@result);
-}
-
=item build_authorized_values_list
}
if ($#subfields_data>=0) {
my %tag_data;
- $tag_data{tag}=$field->tag().' - '. $tagslib->{$field->tag()}->{lib};
+ $tag_data{tag}=$field->tag(). ' '
+ . C4::Koha::display_marc_indicators($field)
+ . ' - '
+ . $tagslib->{$field->tag()}->{lib};
$tag_data{subfield} = \@subfields_data;
push (@loop_data, \%tag_data);
}
my $authtypes = getauthtypes;
my @authtypesloop;
-foreach my $thisauthtype (keys %$authtypes) {
+foreach my $thisauthtype (sort { $authtypes->{$b} cmp $authtypes->{$a} } keys %$authtypes) {
my $selected = 1 if $thisauthtype eq $authtypecode;
my %row =(value => $thisauthtype,
selected => $selected,