Bug 19343: [16.11.X] Remove private lists with edit permission from search results

If the list is not shared, it should not be listed. We only need to remove
the allow_add line.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Conflicts:
	Koha/Virtualshelves.pm
This commit is contained in:
Marcel de Rooy 2017-10-03 16:01:15 +02:00 committed by Mason James
parent 0e17d3bb32
commit a832183e6c
1 changed files with 38 additions and 0 deletions

View File

@ -119,6 +119,44 @@ sub get_some_shelves {
);
}
sub get_shelves_containing_record {
my ( $self, $params ) = @_;
my $borrowernumber = $params->{borrowernumber};
my $biblionumber = $params->{biblionumber};
my @conditions = ( 'virtualshelfcontents.biblionumber' => $biblionumber );
if ($borrowernumber) {
push @conditions,
{
-or => [
{
category => 1,
-or => {
'me.owner' => $borrowernumber,
-or => {
'virtualshelfshares.borrowernumber' => $borrowernumber,
},
}
},
{ category => 2 },
]
};
} else {
push @conditions, { category => 2 };
}
return Koha::Virtualshelves->search(
{
-and => \@conditions
},
{
join => [ 'virtualshelfcontents', 'virtualshelfshares' ],
group_by => 'shelfnumber',
order_by => { -asc => 'shelfname' },
}
);
}
sub _type {
return 'Virtualshelve';
}