Bug 8032: Sort lists by call number
Precaution: Joining the items table makes that the table is sorted on the item call number of the first item (in case there are more items). Signed-off-by: Melia Meggs <melia@test.bywatersolutions.com> Passed-QA-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
parent
0f6487bc32
commit
aad2599fb1
4 changed files with 15 additions and 3 deletions
|
@ -266,11 +266,12 @@ sub GetShelfContents {
|
|||
($sortfield) = $sth2->fetchrow_array;
|
||||
}
|
||||
my $query =
|
||||
" SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
|
||||
" SELECT DISTINCT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
|
||||
biblio.*, biblioitems.itemtype, biblioitems.publicationyear as year, biblioitems.publishercode, biblioitems.place, biblioitems.size, biblioitems.pages
|
||||
FROM virtualshelfcontents vc
|
||||
JOIN biblio ON vc.biblionumber = biblio.biblionumber
|
||||
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
|
||||
LEFT JOIN items ON items.biblionumber=vc.biblionumber
|
||||
LEFT JOIN itemtypes ON biblioitems.itemtype = itemtypes.itemtype
|
||||
WHERE vc.shelfnumber=? ";
|
||||
my @params = ($shelfnumber);
|
||||
|
|
|
@ -304,6 +304,7 @@ sub shelfpage {
|
|||
viewshelf => $shelfnumber,
|
||||
authorsort => $authorsort,
|
||||
yearsort => $yearsort,
|
||||
itemcallnumbersort => $sortfield eq 'itemcallnumber',
|
||||
manageshelf => $manageshelf,
|
||||
allowremovingitems => ShelfPossibleAction( $loggedinuser, $shelfnumber, 'delete'),
|
||||
allowaddingitem => ShelfPossibleAction( $loggedinuser, $shelfnumber, 'add'),
|
||||
|
@ -418,6 +419,8 @@ sub shelfpage {
|
|||
$shelflist->{$element}->{"authorsort"} = 'author';
|
||||
} elsif ( $sortfield eq 'year' ) {
|
||||
$shelflist->{$element}->{"yearsort"} = 'year';
|
||||
} elsif ( $sortfield eq 'itemcallnumber' ) {
|
||||
$shelflist->{$element}->{"itemcallnumbersort"} = 'itemcallnumber';
|
||||
}
|
||||
}
|
||||
$shelflist->{$element}->{"viewcategory$category"} = 1;
|
||||
|
|
|
@ -210,6 +210,7 @@ function placeHold () {
|
|||
<th>Title</th>
|
||||
<th>Author</th>
|
||||
<th>Date added</th>
|
||||
<th>Call number</th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
[% FOREACH itemsloo IN itemsloop %]
|
||||
|
@ -238,6 +239,9 @@ function placeHold () {
|
|||
<td>[% itemsloo.author %]</td>
|
||||
<td>[% itemsloo.dateadded %]</td>
|
||||
<td>
|
||||
[% FOREACH result IN itemsloo.ITEM_RESULTS %][% result.itemcallnumber %][% UNLESS loop.last %], [% END %][% END %]
|
||||
</td>
|
||||
<td>
|
||||
[% UNLESS ( itemsloo.notforloan ) %]
|
||||
<a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% itemsloo.biblionumber %]">Holds</a>
|
||||
[% END %]
|
||||
|
@ -299,6 +303,7 @@ function placeHold () {
|
|||
[% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
|
||||
[% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
|
||||
[% IF ( sort_copyrightdate ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
|
||||
[% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
|
||||
</select></li>
|
||||
<li><label for="category">Category: </label>
|
||||
<select name="category" id="category">
|
||||
|
@ -322,6 +327,7 @@ function placeHold () {
|
|||
[% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
|
||||
[% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
|
||||
[% IF ( sort_copyrightdate ) %]<option value="copyrightdate" selected="selected">Copyrightdate</option>[% ELSE %]<option value="copyrightdate">Copyrightdate</option>[% END %]
|
||||
[% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
|
||||
</select></li>
|
||||
<li><label for="category">Category: </label>
|
||||
<select id="category" name="category">
|
||||
|
@ -386,7 +392,7 @@ function placeHold () {
|
|||
[% IF ( shelveslooppri.toggle ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
|
||||
<td><a href="shelves.pl?[% IF ( shelveslooppri.showprivateshelves ) %]display=privateshelves&[% END %]viewshelf=[% shelveslooppri.shelf %]&shelfoff=[% shelfoff %]">[% shelveslooppri.shelfname |html %]</a></td>
|
||||
<td>[% shelveslooppri.count %] item(s)</td>
|
||||
<td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
|
||||
<td>[% IF ( shelveslooppri.authorsort ) %]Author[% ELSIF ( shelveslooppri.yearsort ) %]Year[% ELSIF (shelveslooppri.itemcallnumbersort) %]Call number[% ELSE %]Title[% END %]</td>
|
||||
<td>[% IF ( shelveslooppri.viewcategory1 ) %]Private[% END %]
|
||||
[% IF ( shelveslooppri.viewcategory2 ) %]Public[% END %]
|
||||
</td>
|
||||
|
@ -439,7 +445,7 @@ function placeHold () {
|
|||
<td><a href="shelves.pl?viewshelf=[% shelvesloo.shelf %]">[% shelvesloo.shelfname |html %]</a></td>
|
||||
<td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% shelvesloo.owner %]">[% shelvesloo.ownername %]</td>
|
||||
<td>[% shelvesloo.count %] item(s)</td>
|
||||
<td>[% IF ( shelvesloo.authorsort ) %]Author[% ELSIF ( shelvesloo.yearsort ) %]Year[% ELSE %]Title[% END %]</td>
|
||||
<td>[% IF ( shelvesloo.authorsort ) %]Author[% ELSIF ( shelvesloo.yearsort ) %]Year[% ELSIF (shelvesloo.itemcallnumbersort) %]Call number[% ELSE %]Title[% END %]</td>
|
||||
<td>[% IF ( shelvesloo.viewcategory1 ) %]Private[% END %]
|
||||
[% IF ( shelvesloo.viewcategory2 ) %]Public[% END %]
|
||||
</td>
|
||||
|
|
|
@ -488,6 +488,7 @@ $(function() {
|
|||
[% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
|
||||
[% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
|
||||
[% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
|
||||
[% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
|
@ -677,6 +678,7 @@ $(function() {
|
|||
[% IF ( sort_title ) %]<option value="title" selected="selected">Title</option>[% ELSE %]<option value="title">Title</option>[% END %]
|
||||
[% IF ( sort_author ) %]<option value="author" selected="selected">Author</option>[% ELSE %]<option value="author">Author</option>[% END %]
|
||||
[% IF ( sort_year ) %]<option value="year" selected="selected">Year</option>[% ELSE %]<option value="year">Year</option>[% END %]
|
||||
[% IF ( sort_itemcallnumber ) %]<option value="itemcallnumber" selected="selected">Call number</option>[% ELSE %]<option value="itemcallnumber">Call number</option>[% END %]
|
||||
</select>
|
||||
</li>
|
||||
<li>
|
||||
|
|
Loading…
Reference in a new issue