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 120-126 if ( $op eq 'add_form' ) { Link Here
120
    if ( $shelf ) {
120
    if ( $shelf ) {
121
        $op = $referer;
121
        $op = $referer;
122
        my $sortfield = $query->param('sortfield');
122
        my $sortfield = $query->param('sortfield');
123
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
123
        $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded );
124
        if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){
125
            $sortfield = 'publicationyear';
126
        }
124
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
127
        if ( $shelf->can_be_managed( $loggedinuser ) ) {
125
            $shelf->shelfname( scalar $query->param('shelfname') );
128
            $shelf->shelfname( scalar $query->param('shelfname') );
126
            $shelf->sortfield( $sortfield );
129
            $shelf->sortfield( $sortfield );
Lines 278-284 if ( $op eq 'view' ) { Link Here
278
    if ( $shelf ) {
281
    if ( $shelf ) {
279
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
282
        if ( $shelf->can_be_viewed( $loggedinuser ) ) {
280
            my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title';    # Passed in sorting overrides default sorting
283
            my $sortfield = $query->param('sortfield') || $shelf->sortfield || 'title';    # Passed in sorting overrides default sorting
281
            $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate itemcallnumber dateadded );
284
            $sortfield = 'title' unless grep { $_ eq $sortfield } qw( title author copyrightdate publicationyear itemcallnumber dateadded );
285
            if ($sortfield == 'copyrightdate' and C4::Context->preference('marcflavour')=='UNIMARC'){
286
                $sortfield = 'publicationyear';
287
            }
282
            my $direction = $query->param('direction') || 'asc';
288
            my $direction = $query->param('direction') || 'asc';
283
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
289
            $direction = 'asc' if $direction ne 'asc' and $direction ne 'desc';
284
            my $rows;
290
            my $rows;
285
- 

Return to bug 37434