Bug 38130: Allow sorting and filtering on library id and name
On the item list of the bib detail page and the patron search we want
the library columns ('holding library', 'home library' and 'library') to
be sorted by library names and to make them searchable on library id and
name.
Concerns about this approach (comment #8):
"""
If we do it for the library names on this view, we need to do it for all the library columns (thinking about patrons right now but I am sure there are others). And to be consistent, for all the other coded values: "special AVs" (item types, cn source), regular AVs, patron category codes, etc.
We will introduce additional JOINs and so maybe performance problems. This needs to be investigated before we take this route IMO.
"""
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1f5e3b66f8)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
67bba93fd1
commit
db6915c009
|
|
@ -499,7 +499,7 @@ Returns a Koha::Library object representing the patron's home library.
|
|||
|
||||
sub library {
|
||||
my ( $self ) = @_;
|
||||
return Koha::Library->_new_from_dbic($self->_result->branchcode);
|
||||
return Koha::Library->_new_from_dbic($self->_result->library);
|
||||
}
|
||||
|
||||
=head3 sms_provider
|
||||
|
|
|
|||
|
|
@ -2191,6 +2191,13 @@ __PACKAGE__->many_to_many("permissions", "user_permissions", "permission");
|
|||
# Created by DBIx::Class::Schema::Loader v0.07051 @ 2024-05-02 11:36:36
|
||||
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jUOMoSonNmA3KwtZKVxqOA
|
||||
|
||||
__PACKAGE__->belongs_to(
|
||||
"library",
|
||||
"Koha::Schema::Result::Branch",
|
||||
{ branchcode => "branchcode" },
|
||||
{ is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
|
||||
);
|
||||
|
||||
__PACKAGE__->has_many(
|
||||
"restrictions",
|
||||
"Koha::Schema::Result::BorrowerDebarment",
|
||||
|
|
|
|||
|
|
@ -376,7 +376,7 @@
|
|||
},
|
||||
[% END %]
|
||||
{
|
||||
data: "me.holding_library_id:holding_library.name",
|
||||
data: "holding_library.name:me.holding_library_id",
|
||||
className: "location",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
|
|
@ -385,7 +385,7 @@
|
|||
}
|
||||
},
|
||||
{
|
||||
data: "me.home_library_id:home_library.name",
|
||||
data: "home_library.name:me.home_library_id",
|
||||
className: "homebranch",
|
||||
searchable: true,
|
||||
orderable: true,
|
||||
|
|
|
|||
|
|
@ -532,15 +532,14 @@
|
|||
}
|
||||
[% CASE 'branch' %]
|
||||
{
|
||||
"data": "library_id",
|
||||
"data": "library.name:me.library_id",
|
||||
"searchable": true,
|
||||
"orderable": true,
|
||||
"render": function( data, type, row, meta ) {
|
||||
let library_name = libraries_map[data].branchname
|
||||
if( !singleBranchMode && data == logged_in_library_id ) {
|
||||
return "<span class=\"currentlibrary\">" + escape_str(library_name) + "</span>";
|
||||
if( !singleBranchMode && row.library.library_id == logged_in_library_id ) {
|
||||
return "<span class=\"currentlibrary\">" + escape_str(row.library.name) + "</span>";
|
||||
} else {
|
||||
return escape_str(library_name);
|
||||
return escape_str(row.library.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue