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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (+2 lines)
Lines 439-444 Link Here
439
                                    [% END %]
439
                                    [% END %]
440
                                    [% IF shelf.sortfield == "copyrightdate" %]
440
                                    [% IF shelf.sortfield == "copyrightdate" %]
441
                                        <option value="copyrightdate" selected="selected">Copyrightdate</option>
441
                                        <option value="copyrightdate" selected="selected">Copyrightdate</option>
442
                                    [% ELSIF shelf.sortfield == "publicationyear" %]
443
                                        <option value="publicationyear" selected="selected">Copyrightdate</option>
442
                                    [% ELSE %]
444
                                    [% ELSE %]
443
                                        <option value="copyrightdate">Copyrightdate</option>
445
                                        <option value="copyrightdate">Copyrightdate</option>
444
                                    [% END %]
446
                                    [% END %]
(-)a/virtualshelves/shelves.pl (-3 / +8 lines)
Lines 114-120 if ( $op eq 'add_form' ) { Link Here
114
    if ( $shelf ) {
114
    if ( $shelf ) {
115
        $op = $referer;
115
        $op = $referer;
116
        my $sortfield = $query->param('sortfield');
116
        my $sortfield = $query->param('sortfield');
117
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
117
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded );
118
        if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){
119
            $sortfield = 'publicationyear';
120
        }
118
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
121
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
119
            $shelf->shelfname( scalar $query->param('shelfname') );
122
            $shelf->shelfname( scalar $query->param('shelfname') );
120
            $shelf->sortfield( $sortfield );
123
            $shelf->sortfield( $sortfield );
Lines 272-278 if ( $op eq 'view' ) { Link Here
272
    if ( $shelf ) {
275
    if ( $shelf ) {
273
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
276
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
274
            my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title';    # Passed in sorting overrides default sorting
277
            my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title';    # Passed in sorting overrides default sorting
275
            $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
278
            $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded );
279
            if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){
280
                $sortfield = 'publicationyear';
281
            }
276
            my $direction = $query->param('direction') || 'asc';
282
            my $direction = $query->param('direction') || 'asc';
277
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
283
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
278
            my $rows;
284
            my $rows;
279
- 

Return to bug 37434