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

(-)a/C4/VirtualShelves/Page.pm (-1 / +3 lines)
Lines 249-254 sub shelfpage { Link Here
249
                my $items;
249
                my $items;
250
                my $tag_quantity;
250
                my $tag_quantity;
251
                my $sortfield = ( $sorton ? $sorton : 'title' );
251
                my $sortfield = ( $sorton ? $sorton : 'title' );
252
                $sortfield = $query->param('sort') || $sortfield; ## Passed in sorting overrides default sorting
252
                ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield );
253
                ( $items, $totitems ) = GetShelfContents( $shelfnumber, $shelflimit, $shelfoffset, $sortfield );
253
                for my $this_item (@$items) {
254
                for my $this_item (@$items) {
254
                    my $biblionumber = $this_item->{'biblionumber'};
255
                    my $biblionumber = $this_item->{'biblionumber'};
Lines 419-425 sub shelfpage { Link Here
419
420
420
    my $url = $type eq 'opac' ? "/cgi-bin/koha/opac-shelves.pl" : "/cgi-bin/koha/virtualshelves/shelves.pl";
421
    my $url = $type eq 'opac' ? "/cgi-bin/koha/opac-shelves.pl" : "/cgi-bin/koha/virtualshelves/shelves.pl";
421
    my %qhash = ();
422
    my %qhash = ();
422
    foreach (qw(display viewshelf sortfield)) {
423
    foreach (qw(display viewshelf sortfield sort)) {
423
        $qhash{$_} = $query->param($_) if $query->param($_);
424
        $qhash{$_} = $query->param($_) if $query->param($_);
424
    }
425
    }
425
    ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash;
426
    ( scalar keys %qhash ) and $url .= '?' . join '&', map { "$_=$qhash{$_}" } keys %qhash;
Lines 459-464 sub shelfpage { Link Here
459
            barshelvesloop => $barshelves,
460
            barshelvesloop => $barshelves,
460
            pubshelves     => $total->{pubtotal},
461
            pubshelves     => $total->{pubtotal},
461
            pubshelvesloop => $pubshelves,
462
            pubshelvesloop => $pubshelves,
463
            sort           => $query->param('sort'),
462
    );
464
    );
463
465
464
    output_html_with_http_headers $query, $cookie, $template->output;
466
    output_html_with_http_headers $query, $cookie, $template->output;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt (-3 / +15 lines)
Lines 207-216 function placeHold () { Link Here
207
            <tr>
207
            <tr>
208
                [% IF ( itemsloop ) %]<th class="checkall">&nbsp;</th>[% END %]
208
                [% IF ( itemsloop ) %]<th class="checkall">&nbsp;</th>[% END %]
209
                [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
209
                [% UNLESS ( item_level_itypes ) %]<th>Item type</th>[% END %]
210
                <th>Title</th>
210
                <th>
211
                <th>Author</th>
211
                    [% IF sort == 'title' %]<i>[% END %]
212
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&sort=title">Title</a>
213
                    [% IF sort == 'title' %]</i>[% END %]
214
                </th>
215
                <th>
216
                    [% IF sort == 'author' %]<i>[% END %]
217
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&sort=author">Author</a>
218
                    [% IF sort == 'author' %]</i>[% END %]
219
                </th>
212
                <th>Date added</th>
220
                <th>Date added</th>
213
                <th>Call number</th>
221
                <th>
222
                    [% IF sort == 'itemcallnumber' %]<i>[% END %]
223
                    <a href="/cgi-bin/koha/virtualshelves/shelves.pl?viewshelf=[% shelfnumber %]&sort=itemcallnumber">Call number</a>
224
                    [% IF sort == 'itemcallnumber' %]</i>[% END %]
225
                </th>
214
                <th>&nbsp;</th>
226
                <th>&nbsp;</th>
215
            </tr>
227
            </tr>
216
		[% FOREACH itemsloo IN itemsloop %]
228
		[% FOREACH itemsloo IN itemsloop %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tt (-1 / +27 lines)
Lines 287-292 $(function() { Link Here
287
287
288
<a class="print" href="opac-shelves.pl" onclick="print(); return false;">Print list</a>
288
<a class="print" href="opac-shelves.pl" onclick="print(); return false;">Print list</a>
289
289
290
<form action="/cgi-bin/koha/opac-shelves.pl" id="sorting-form">
291
    <input type="hidden" name="viewshelf" value="[% shelfnumber %]" />
292
293
    <label for="sort">Sort by: </label>
294
    <select name="sort" onchange="$('#sorting-form').submit()">
295
        <option value="">Default sorting</option>
296
297
        [% IF sort == 'author' %]
298
            <option value="author" selected="selected">Author</option>
299
        [% ELSE %]
300
            <option value="author">Author</option>
301
        [% END %]
302
303
        [% IF sort == 'title' %]
304
            <option value="title" selected="selected">Title</option>
305
        [% ELSE %]
306
            <option value="title">Title</option>
307
        [% END %]
308
309
        [% IF sort == 'itemcallnumber' %]
310
            <option value="itemcallnumber" selected="selected">Call number</option>
311
        [% ELSE %]
312
            <option value="itemcallnumber">Call number</option>
313
        [% END %]
314
    </select>
315
</form>
316
290
                [% IF ( manageshelf ) %] <span class="sep">|</span> <form method="get" action="opac-shelves.pl"><input type="hidden" name="op" value="modif" />
317
                [% IF ( manageshelf ) %] <span class="sep">|</span> <form method="get" action="opac-shelves.pl"><input type="hidden" name="op" value="modif" />
291
                <input type="hidden" name="display" value="viewshelf" />
318
                <input type="hidden" name="display" value="viewshelf" />
292
                <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf" value="Edit list" /></form>
319
                <input type="hidden" name="shelfnumber" value="[% shelfnumber %]" /> <input type="submit" class="editshelf" value="Edit list" /></form>
293
- 

Return to bug 9458