(bug #3497) show publication year, or copyrightdate
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Wed, 5 Aug 2009 08:07:36 +0000 (10:07 +0200)
committerGalen Charlton <gmcharlt@gmail.com>
Thu, 6 Aug 2009 00:11:00 +0000 (20:11 -0400)
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>
C4/VirtualShelves.pm
C4/VirtualShelves/Page.pm
koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl

index 31dcdb7..76786e9 100644 (file)
@@ -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
index 999692c..2c44daf 100644 (file)
@@ -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,
                        );
index b0e1b73..5458799 100644 (file)
@@ -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>