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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (+18 lines)
Lines 337-342 Link Here
337
                                                    <option value="dateadded" data-direction="asc">Date added (oldest to newest)</option>
337
                                                    <option value="dateadded" data-direction="asc">Date added (oldest to newest)</option>
338
                                                [% END %]
338
                                                [% END %]
339
                                            </optgroup>
339
                                            </optgroup>
340
                                            <optgroup label="Date accessioned">
341
                                                [% IF sortfield == "dateaccessioned" && direction == 'asc' %]
342
                                                    <option value="dateaccessioned" data-direction="desc" selected="selected">Date accessioned (newest to oldest</option>
343
                                                [% ELSE %]
344
                                                    <option value="dateaccessioned" data-direction="desc">Date accessioned (newest to oldest)</option>
345
                                                [% END %]
346
                                                [% IF sortfield == "dateaccessioned" && direction == 'desc' %]
347
                                                    <option value="dateaccessioned" data-direction="asc" selected="selected">Date accessioned (oldest to newest)</option>
348
349
                                                [% ELSE %]
350
                                                    <option value="dateaccessioned" data-direction="asc">Date accessioned (oldest to newest)</option>
351
                                                [% END %]
352
                                            </optgroup>
340
                                        </select>
353
                                        </select>
341
354
342
                                        <input type="submit" class="btn btn-primary btn-sm" id="sort-submit" value="Resort list" />
355
                                        <input type="submit" class="btn btn-primary btn-sm" id="sort-submit" value="Resort list" />
Lines 621-626 Link Here
621
                                            [% ELSE %]
634
                                            [% ELSE %]
622
                                                <option value="dateadded">Date added</option>
635
                                                <option value="dateadded">Date added</option>
623
                                            [% END %]
636
                                            [% END %]
637
                                            [% IF shelf.sortfield == "dateaccessioned" %]
638
                                                <option value="dateaccessioned" selected="selected">Date accessioned</option>
639
                                            [% ELSE %]
640
                                                <option value="dateaccessioned">Date accessioned</option>
641
                                            [% END %]
624
                                        </select>
642
                                        </select>
625
                                    </li>
643
                                    </li>
626
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
644
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
(-)a/opac/opac-shelves.pl (-3 / +2 lines)
Lines 147-153 if ( $op eq 'add_form' ) { Link Here
147
    if ( $shelf ) {
147
    if ( $shelf ) {
148
        $op = $referer;
148
        $op = $referer;
149
        my $sortfield = $query->param('sortfield');
149
        my $sortfield = $query->param('sortfield');
150
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
150
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned );
151
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
151
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
152
            $shelf->shelfname( scalar $query->param('shelfname') );
152
            $shelf->shelfname( scalar $query->param('shelfname') );
153
            $shelf->sortfield( $sortfield );
153
            $shelf->sortfield( $sortfield );
Lines 313-319 if ( $op eq 'view' ) { Link Here
313
            }
313
            }
314
            $direction = $query->param('direction') if $query->param('direction');
314
            $direction = $query->param('direction') if $query->param('direction');
315
            $direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' );
315
            $direction = 'asc' if !$direction or ( $direction ne 'asc' and $direction ne 'desc' );
316
            $sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
316
            $sortfield = 'title' if !$sortfield or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned );
317
317
318
            my ( $page, $rows );
318
            my ( $page, $rows );
319
            unless ( $query->param('print') or $query->param('rss') ) {
319
            unless ( $query->param('print') or $query->param('rss') ) {
320
- 

Return to bug 36188