&subfield_is_koha_internal_p
&GetPrinters &GetPrinter
&GetItemTypes &getitemtypeinfo
- &GetCcodes
&GetSupportName &GetSupportList
&get_itemtypeinfos_of
&getframeworks &getframeworkinfo
return get_infos_of( $query, 'itemtype', undef, \@itemtypes );
}
-# this is temporary until we separate collection codes and item types
-sub GetCcodes {
- my $count = 0;
- my @results;
- my $dbh = C4::Context->dbh;
- my $sth =
- $dbh->prepare(
- "SELECT * FROM authorised_values ORDER BY authorised_value");
- $sth->execute;
- while ( my $data = $sth->fetchrow_hashref ) {
- if ( $data->{category} eq "CCODE" ) {
- $count++;
- $results[$count] = $data;
-
- #warn "data: $data";
- }
- }
- $sth->finish;
- return ( $count, @results );
-}
-
=head2 getauthtypes
$authtypes = &getauthtypes();
tags => [ qw/ 225a / ],
sep => ', ',
},
+ {
+ idx => 'location',
+ label => 'Location',
+ tags => [ qw/ 995c / ],
+ }
];
my $library_facet;
label => 'Libraries',
tags => [ qw/ 995b / ],
};
- } else {
- $library_facet = {
- idx => 'location',
- label => 'Location',
- tags => [ qw/ 995c / ],
- };
}
push( @$facets, $library_facet );
}
tags => [ qw/ 952y 942c / ],
sep => ', ',
},
+ {
+ idx => 'location',
+ label => 'Location',
+ tags => [ qw / 952c / ],
+ },
];
my $library_facet;
label => 'Libraries',
tags => [ qw / 952b / ],
};
- } else {
- $library_facet = {
- idx => 'location',
- label => 'Location',
- tags => [ qw / 952c / ],
- };
}
push( @$facets, $library_facet );
}
if(@where_strings > 0) {
$query .= " WHERE " . join(" AND ", @where_strings);
}
- $query .= " GROUP BY lib ORDER BY category, lib, lib_opac";
+ $query .= " GROUP BY lib";
+ $query .= ' ORDER BY category, ' . (
+ $opac ? 'COALESCE(lib_opac, lib)'
+ : 'lib, lib_opac'
+ );
my $sth = $dbh->prepare($query);