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

(-)a/C4/Auth.pm (+4 lines)
Lines 333-343 sub get_template_and_user { Link Here
333
                {
333
                {
334
                    borrowernumber => $borrowernumber,
334
                    borrowernumber => $borrowernumber,
335
                    public         => 0,
335
                    public         => 0,
336
                    search_attributes => {order_by => { -asc => 'shelfname' }},
336
                }
337
                }
337
            );
338
            );
338
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
339
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
339
                {
340
                {
340
                    public => 1,
341
                    public => 1,
342
                    search_attributes => {order_by => { -asc => 'shelfname' }},
341
                }
343
                }
342
            );
344
            );
343
            $template->param(
345
            $template->param(
Lines 420-425 sub get_template_and_user { Link Here
420
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
422
            my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
421
                {
423
                {
422
                    public => 1,
424
                    public => 1,
425
                    search_attributes => {order_by => { -asc => 'shelfname' }},
423
                }
426
                }
424
            );
427
            );
425
            $template->param(
428
            $template->param(
Lines 1481-1486 sub checkauth { Link Here
1481
        my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
1484
        my $some_public_shelves = Koha::Virtualshelves->get_some_shelves(
1482
            {
1485
            {
1483
                public => 1,
1486
                public => 1,
1487
                search_attributes => {order_by => { -asc => 'shelfname' }},
1484
            }
1488
            }
1485
        );
1489
        );
1486
        $template->param(
1490
        $template->param(
(-)a/Koha/Virtualshelves.pm (-6 / +9 lines)
Lines 191-206 sub get_some_shelves { Link Here
191
        };
191
        };
192
    }
192
    }
193
193
194
    my $default_search_attributes =  {
195
        join => [ 'virtualshelfshares' ],
196
        distinct => 'shelfnumber',
197
        order_by => { -desc => 'lastmodified' },
198
    };
199
200
    my %search_attributes = defined($params->{search_attributes}) ? (%{$default_search_attributes}, %{$params->{search_attributes}}) : %{$default_search_attributes};
201
194
    $self->search(
202
    $self->search(
195
        {
203
        {
196
            public => $public,
204
            public => $public,
197
            ( @conditions ? ( -and => \@conditions ) : () ),
205
            ( @conditions ? ( -and => \@conditions ) : () ),
198
        },
206
        },
199
        {
207
        \%search_attributes
200
            join => [ 'virtualshelfshares' ],
201
            distinct => 'shelfnumber',
202
            order_by => { -desc => 'lastmodified' },
203
        }
204
    );
208
    );
205
}
209
}
206
210
207
- 

Return to bug 38712