View | Details | Raw Unified | Return to bug 28965
Collapse All | Expand All

(-)a/Koha/REST/V1/Lists.pm (-2 / +2 lines)
Lines 36-43 sub list_public { Link Here
36
36
37
    my $user = $c->stash('koha.user');
37
    my $user = $c->stash('koha.user');
38
38
39
    my $only_mine   = delete $c->param('only_mine');
39
    my $only_mine   = $c->param('only_mine');
40
    my $only_public = delete $c->param('only_public');
40
    my $only_public = $c->param('only_public');
41
41
42
    return $c->render(
42
    return $c->render(
43
        status  => 400,
43
        status  => 400,
(-)a/Koha/Virtualshelf.pm (-2 / +3 lines)
Lines 398-403 sub transfer_ownership { Link Here
398
    return $self;
398
    return $self;
399
}
399
}
400
400
401
401
=head3 to_api_mapping
402
=head3 to_api_mapping
402
403
403
This method returns the mapping for representing a Koha::Virtualshelf object
404
This method returns the mapping for representing a Koha::Virtualshelf object
Lines 424-431 This method returns the list of publicly readable database fields for both API a Link Here
424
425
425
sub public_read_list {
426
sub public_read_list {
426
    return [
427
    return [
427
        'created_on',  'lastmodified', 'shelfname',
428
        'created_on',              'lastmodified', 'shelfname',
428
        'shelfnumber', 'public',       'sortfield',
429
        'shelfnumber',             'public',       'sortfield',
429
        'allow_change_from_owner', 'allow_change_from_others'
430
        'allow_change_from_owner', 'allow_change_from_others'
430
    ];
431
    ];
431
}
432
}
(-)a/Koha/Virtualshelves.pm (-2 / +2 lines)
Lines 257-263 Returns a resultset of lists marked as public. Link Here
257
sub filter_by_public {
257
sub filter_by_public {
258
    my ($self) = @_;
258
    my ($self) = @_;
259
259
260
    return $self->search({ public => 1 });
260
    return $self->search( { public => 1 } );
261
}
261
}
262
262
263
=head3 filter_by_readable
263
=head3 filter_by_readable
Lines 272-278 sub filter_by_readable { Link Here
272
    my ( $self, $params ) = @_;
272
    my ( $self, $params ) = @_;
273
273
274
    Koha::Exceptions::MissingParameter->throw("Mandatory patron_id parameter missing")
274
    Koha::Exceptions::MissingParameter->throw("Mandatory patron_id parameter missing")
275
      unless $params->{patron_id};
275
        unless $params->{patron_id};
276
276
277
    return $self->search( { '-or' => { public => 1, owner => $params->{patron_id} } } );
277
    return $self->search( { '-or' => { public => 1, owner => $params->{patron_id} } } );
278
}
278
}
(-)a/t/db_dependent/Virtualshelves.t (-2 / +1 lines)
Lines 16-22 Link Here
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
use Test::More tests => 7;
19
use Test::More tests => 9;
20
use Test::Exception;
20
use Test::Exception;
21
21
22
use DateTime::Duration;
22
use DateTime::Duration;
23
- 

Return to bug 28965