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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt (+17 lines)
Lines 368-373 Link Here
368
                                                    <option value="dateadded" data-direction="asc">Date added (oldest to newest)</option>
368
                                                    <option value="dateadded" data-direction="asc">Date added (oldest to newest)</option>
369
                                                [% END %]
369
                                                [% END %]
370
                                            </optgroup>
370
                                            </optgroup>
371
                                            <optgroup label="Date acquired">
372
                                                [% IF sortfield == "dateaccessioned" && direction == 'asc' %]
373
                                                    <option value="dateaccessioned" data-direction="desc" selected="selected">Date acquired (newest to oldest)</option>
374
                                                [% ELSE %]
375
                                                    <option value="dateaccessioned" data-direction="desc">Date acquired (newest to oldest)</option>
376
                                                [% END %]
377
                                                [% IF sortfield == "dateaccessioned" && direction == 'desc' %]
378
                                                    <option value="dateaccessioned" data-direction="asc" selected="selected">Date acquired (oldest to newest)</option>
379
                                                [% ELSE %]
380
                                                    <option value="dateaccessioned" data-direction="asc">Date acquired (oldest to newest)</option>
381
                                                [% END %]
382
                                            </optgroup>
371
                                        </select>
383
                                        </select>
372
384
373
                                        <input type="submit" class="btn btn-primary btn-sm" id="sort-submit" value="Resort list" />
385
                                        <input type="submit" class="btn btn-primary btn-sm" id="sort-submit" value="Resort list" />
Lines 647-652 Link Here
647
                                            [% ELSE %]
659
                                            [% ELSE %]
648
                                                <option value="dateadded">Date added</option>
660
                                                <option value="dateadded">Date added</option>
649
                                            [% END %]
661
                                            [% END %]
662
                                            [% IF shelf.sortfield == "dateaccessioned" %]
663
                                                <option value="dateaccessioned" selected="selected">Date acquired</option>
664
                                            [% ELSE %]
665
                                                <option value="dateaccessioned">Date acquired</option>
666
                                            [% END %]
650
                                        </select>
667
                                        </select>
651
                                    </li>
668
                                    </li>
652
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
669
                                    [% IF Koha.Preference('OpacAllowPublicListCreation') OR public == 1 %]
(-)a/opac/opac-shelves.pl (-3 / +3 lines)
Lines 154-160 if ( $op eq 'add_form' ) { Link Here
154
    if ($shelf) {
154
    if ($shelf) {
155
        $op = $referer;
155
        $op = $referer;
156
        my $sortfield = $query->param('sortfield');
156
        my $sortfield = $query->param('sortfield');
157
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
157
        $sortfield = 'title'
158
            unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned );
158
        if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
159
        if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
159
            $sortfield = 'publicationyear';
160
            $sortfield = 'publicationyear';
160
        }
161
        }
Lines 330-336 if ( $op eq 'view' ) { Link Here
330
            $direction = 'asc'                      if !$direction or ( $direction ne 'asc' and $direction ne 'desc' );
331
            $direction = 'asc'                      if !$direction or ( $direction ne 'asc' and $direction ne 'desc' );
331
            $sortfield = 'title'
332
            $sortfield = 'title'
332
                if !$sortfield
333
                if !$sortfield
333
                or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
334
                or !grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded dateaccessioned );
334
            if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
335
            if ( $sortfield eq 'copyrightdate' and C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
335
                $sortfield = 'publicationyear';
336
                $sortfield = 'publicationyear';
336
            }
337
            }
337
- 

Return to bug 36188