Bug 5687: Add pref StaffAuthorisedValueImages for staff search results
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Tue, 29 Mar 2011 22:30:13 +0000 (18:30 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Wed, 30 Mar 2011 06:33:09 +0000 (19:33 +1300)
This patch contains the functionality, not the install stuff.

Revised: with input of Ian Walls: populate authorised_value_images only if needed; no changes anymore for template and search.pl.

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
C4/Search.pm
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref

index 21c61fb..f618c6a 100644 (file)
@@ -1482,7 +1482,7 @@ sub searchResults {
         # add imageurl to itemtype if there is one
         $oldbiblio->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
 
-        $oldbiblio->{'authorised_value_images'}  = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{'biblionumber'}, $marcrecord ) );
+        $oldbiblio->{'authorised_value_images'}  = ($search_context eq 'opac' && C4::Context->preference('AuthorisedValueImages')) || ($search_context eq 'intranet' && C4::Context->preference('StaffAuthorisedValueImages')) ? C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $oldbiblio->{'biblionumber'}, $marcrecord ) ) : [];
                $oldbiblio->{normalized_upc}  = GetNormalizedUPC(       $marcrecord,$marcflavour);
                $oldbiblio->{normalized_ean}  = GetNormalizedEAN(       $marcrecord,$marcflavour);
                $oldbiblio->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord,$marcflavour);
index 50dae66..b658954 100644 (file)
@@ -68,6 +68,12 @@ Staff Client:
               choices:
                   local: "included with Koha (faster, will work if internet goes down)."
                   "http://yui.yahooapis.com/2.5.1/build": "from Yahoo's own servers (less demand on your servers)."
+        -
+            - pref: StaffAuthorisedValueImages
+              choices:
+                  yes: Show
+                  no: "Don't show"
+            - images for <a href="/cgi-bin/koha/admin/authorised_values.pl">authorized values</a> (such as lost statuses and locations) in search results.
     Options:
         -
             - pref: viewMARC