Browse Source

(bug #3497) show publication year, or copyrightdate

This change the shelf view in opac, to show publication year, in the column "Year"(that was previously copyrightdate), and is there is no publication year, show copyright date.

Signed-off-by: Galen Charlton <gmcharlt@gmail.com>
3.2.x
Nahuel ANGELINETTI 15 years ago
committed by Galen Charlton
parent
commit
47ecf39e75
  1. 4
      C4/VirtualShelves.pm
  2. 8
      C4/VirtualShelves/Page.pm
  3. 18
      koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl

4
C4/VirtualShelves.pm

@ -266,8 +266,8 @@ sub GetShelfContents ($;$$$) {
($sortfield) = $sth2->fetchrow_array;
}
my $query =
" SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded,
biblio.*, biblioitems.itemtype, itemtypes.*
" SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded, itemtypes.*,
biblio.*, biblioitems.itemtype, biblioitems.publicationyear
FROM virtualshelfcontents vc
LEFT JOIN biblio ON vc.biblionumber = biblio.biblionumber
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber

8
C4/VirtualShelves/Page.pm

@ -171,13 +171,13 @@ SWITCH: {
if ( ShelfPossibleAction( $loggedinuser, $shelfnumber, 'view' ) ) {
my $items;
my $authorsort;
my $copyrightsort;
my $yearsort;
my $sortfield = ($query->param('sortfield') ? $query->param('sortfield') : 'title');
if ($sortfield eq 'author') {
$authorsort = 'author';
}
if ($sortfield eq 'copyrightdate'){
$copyrightsort = 'copyrightdate';
if ($sortfield eq 'year'){
$yearsort = 'year';
}
($items, $totitems) = GetShelfContents($shelfnumber, $shelflimit, $shelfoffset);
for my $this_item (@$items) {
@ -198,7 +198,7 @@ SWITCH: {
shelfnumber => $shelfnumber,
viewshelf => $shelfnumber,
authorsort => $authorsort,
copyrightsort => $copyrightsort,
yearsort => $yearsort,
manageshelf => $manageshelf,
itemsloop => $items,
);

18
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl

@ -85,7 +85,7 @@ $(function() {
<!-- TMPL_IF NAME="manageshelf" -->
<!-- TMPL_IF NAME="authorsort" -->
sortList: [[2,0]],
<!-- TMPL_ELSIF NAME="copyrightsort" -->
<!-- TMPL_ELSIF NAME="yearsort" -->
sortList: [[3,1]],
<!-- TMPL_ELSE -->
sortList: [[1,0]],
@ -94,7 +94,7 @@ $(function() {
<!-- TMPL_ELSE -->
<!-- TMPL_IF NAME="authorsort" -->
sortList: [[1,0]],
<!-- TMPL_ELSIF NAME="copyrightsort" -->
<!-- TMPL_ELSIF NAME="yearsort" -->
sortList: [[2,1]],
<!-- TMPL_ELSE -->
sortList: [[0,0]],
@ -222,7 +222,7 @@ $(function() {
<!-- TMPL_UNLESS NAME="item-level_itypes" --><th>Item Type</th><!-- /TMPL_UNLESS -->
<th>Title</th>
<th>Author</th>
<th>Copyright</th>
<th>Year</th>
</tr></thead>
<tbody>
<!-- TMPL_LOOP NAME="itemsloop" -->
@ -256,7 +256,13 @@ $(function() {
<div id="newtag<!-- TMPL_VAR NAME="biblionumber">_status" class="tagstatus results_summary" style="display:none">Tag status here.</div>
</td>
<td><!-- TMPL_VAR NAME="author" --></td>
<td><!-- TMPL_VAR NAME="copyrightdate" --></td>
<td>
<!-- TMPL_IF NAME="publicationyear" -->
<!-- TMPL_VAR NAME="publicationyear" -->
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="copyrightdate" -->
<!-- /TMPL_IF -->
</td>
</tr>
<!-- /TMPL_LOOP --><!-- /itemsloop -->
</tbody>
@ -296,7 +302,7 @@ $(function() {
<select name="sortfield" id="sortfield">
<!-- TMPL_IF NAME="sort_title" --><option value="title" selected="selected">Title</option><!-- TMPL_ELSE --><option value="title">Title</option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="sort_author" --><option value="author" selected="selected">Author</option><!-- TMPL_ELSE --><option value="author">Author</option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="sort_copyrightdate" --><option value="copyrightdate" selected="selected">Copyrightdate</option><!-- TMPL_ELSE --><option value="copyrightdate">Copyrightdate</option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="sort_year" --><option value="year" selected="selected">Year</option><!-- TMPL_ELSE --><option value="year">Year</option><!-- /TMPL_IF -->
</select>
</li>
<li>
@ -486,7 +492,7 @@ $(function() {
<select name="sortfield" id="sortfield">
<!-- TMPL_IF NAME="sort_title" --><option value="title" selected="selected">Title</option><!-- TMPL_ELSE --><option value="title">Title</option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="sort_author" --><option value="author" selected="selected">Author</option><!-- TMPL_ELSE --><option value="author">Author</option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="sort_copyrightdate" --><option value="copyrightdate" selected="selected">Copyrightdate</option><!-- TMPL_ELSE --><option value="copyrightdate">Copyrightdate</option><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="sort_year" --><option value="year" selected="selected">Year</option><!-- TMPL_ELSE --><option value="year">Year</option><!-- /TMPL_IF -->
</select>
</li>
<li>

Loading…
Cancel
Save