(bug #3267) show items.uri in opac and intranet
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Thu, 28 May 2009 13:12:51 +0000 (15:12 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Mon, 13 Jul 2009 10:42:36 +0000 (12:42 +0200)
This add a column in normal view, with a link to items.uri URL if it exists.

catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl
opac/opac-detail.pl

index a9c7f0e..716d65c 100755 (executable)
@@ -148,7 +148,7 @@ foreach my $item (@items) {
     $item->{'location'} = $shelflocations->{$shelfcode} if ( defined( $shelfcode ) && defined($shelflocations) && exists( $shelflocations->{$shelfcode} ) );
     my $ccode = $item->{'ccode'};
     $item->{'ccode'} = $collections->{$ccode} if ( defined( $ccode ) && defined($collections) && exists( $collections->{$ccode} ) );
-    foreach (qw(ccode enumchron copynumber)) {
+    foreach (qw(ccode enumchron copynumber uri)) {
         $itemfields{$_} = 1 if ( $item->{$_} );
     }
 
@@ -194,6 +194,7 @@ $template->param(
        subtitle    => $subtitle,
        itemdata_ccode      => $itemfields{ccode},
        itemdata_enumchron  => $itemfields{enumchron},
+       itemdata_uri        => $itemfields{uri},
        itemdata_copynumber => $itemfields{copynumber},
        volinfo                         => $itemfields{enumchron} || $dat->{'serial'} ,
        z3950_search_params     => C4::Search::z3950_search_args($dat),
index de8bfd0..cb9dae5 100644 (file)
@@ -170,6 +170,7 @@ function verify_images() {
                 <th>Last seen</th>
                 <th>Barcode</th>
                 <!-- TMPL_IF NAME="volinfo" --><th>Publication Details</th><!-- /TMPL_IF -->
+                <!-- TMPL_IF NAME="itemdata_uri" --><th>URL</th><!-- /TMPL_IF -->
                 <!-- TMPL_IF NAME="itemdata_copynumber" --><th>Copy No.</th><!-- /TMPL_IF -->
             </tr>
             <!-- TMPL_LOOP NAME="itemloop" -->
@@ -271,6 +272,9 @@ function verify_images() {
                                        <!-- /TMPL_IF -->
                                        <!-- TMPL_VAR NAME="serialseq" --><!-- TMPL_IF NAME="publisheddate" --> (<!-- TMPL_VAR NAME="publisheddate" -->)<!-- /TMPL_IF -->
                                </td><!-- /TMPL_IF -->
+                               <!-- TMPL_IF NAME="itemdata_uri" -->
+                                       <td class="uri"><a href="<!-- TMPL_VAR NAME="uri" -->"><!-- TMPL_VAR NAME="uri" --></a></td>
+                               <!-- /TMPL_IF -->
                                <!-- TMPL_IF NAME="itemdata_copynumber" -->
                                        <td class="copynumber"><!-- TMPL_VAR NAME="copynumber" --></td>
                                <!-- /TMPL_IF -->
index 5209c68..648ecc2 100644 (file)
         <!-- TMPL_IF NAME="itemdata_ccode" --><th>Collection</th><!-- /TMPL_IF -->
         <th>Call Number</th>
         <!-- TMPL_IF NAME="itemdata_enumchron" --><th>Vol Info</th><!-- /TMPL_IF -->
+        <!-- TMPL_IF NAME="itemdata_uri" --><th>URL</th><!-- /TMPL_IF -->
         <!-- TMPL_IF NAME="itemdata_copynumber" --><th>Copy</th><!-- /TMPL_IF -->
             <!-- TMPL_IF NAME="serial" -->
         <th>Serial Data</th>
             <!-- TMPL_IF NAME="itemdata_ccode" --><td><!-- TMPL_VAR NAME="ccode" --></td><!-- /TMPL_IF -->
             <td><!-- TMPL_IF NAME="itemcallnumber" --> <!-- TMPL_VAR NAME="itemcallnumber" --><!-- /TMPL_IF --> <!-- TMPL_IF NAME="OPACShelfBrowser" -->(<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;shelfbrowse_itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->#shelfbrowser">Browse Shelf</a>)<!-- /TMPL_IF --></td>
             <!-- TMPL_IF NAME="itemdata_enumchron" --><td><!-- TMPL_VAR NAME="enumchron" --></td><!-- /TMPL_IF -->
+            <!-- TMPL_IF NAME="itemdata_uri" --><td><a href="<!-- TMPL_VAR NAME="uri" -->"><!-- TMPL_VAR NAME="uri" --></a></td><!-- /TMPL_IF -->
             <!-- TMPL_IF NAME="itemdata_copynumber" --><td><!-- TMPL_VAR NAME="copynumber" --></td><!-- /TMPL_IF -->
             <!-- TMPL_IF NAME="serial" --><td><!-- TMPL_VAR NAME="serialseq" --> </td>
             <td><!-- TMPL_VAR NAME="publisheddate" --> </td><!-- /TMPL_IF -->
index 679a48b..c928ddb 100755 (executable)
@@ -151,7 +151,7 @@ for my $itm (@items) {
         $itm->{'imageurl'}    = getitemtypeimagelocation( 'opac', $itemtypes->{ $itm->{itype} }->{'imageurl'} );
         $itm->{'description'} = $itemtypes->{ $itm->{itype} }->{'description'};
     }
-    foreach (qw(ccode enumchron copynumber itemnotes)) {
+    foreach (qw(ccode enumchron copynumber itemnotes uri)) {
         $itemfields{$_} = 1 if ($itm->{$_});
     }
 
@@ -198,6 +198,7 @@ my $subtitle         = C4::Biblio::get_koha_field_from_marc('bibliosubtitle', 's
                      RequestOnOpac           => C4::Context->preference("RequestOnOpac"),
                      itemdata_ccode          => $itemfields{ccode},
                      itemdata_enumchron      => $itemfields{enumchron},
+                     itemdata_uri            => $itemfields{uri},
                      itemdata_copynumber     => $itemfields{copynumber},
                      itemdata_itemnotes          => $itemfields{itemnotes},
                      authorised_value_images => $biblio_authorised_value_images,