$template->param(
OpacAdditionalStylesheet => C4::Context->preference("OpacAdditionalStylesheet"),
AnonSuggestions => "" . C4::Context->preference("AnonSuggestions"),
- AuthorisedValueImages => C4::Context->preference("AuthorisedValueImages"),
BranchesLoop => GetBranchesLoop($opac_name),
BranchCategoriesLoop => $library_categories,
opac_name => $opac_name,
return $biblionumber;
}
-=head2 get_biblio_authorised_values
-
-find the types and values for all authorised values assigned to this biblio.
-
-parameters:
- biblionumber
- MARC::Record of the bib
-
-returns: a hashref mapping the authorised value to the value set for this biblionumber
-
- $authorised_values = {
- 'Scent' => 'flowery',
- 'Audience' => 'Young Adult',
- 'itemtypes' => 'SER',
- };
-
-Notes: forlibrarian should probably be passed in, and called something different.
-
-=cut
-
-sub get_biblio_authorised_values {
- my $biblionumber = shift;
- my $record = shift;
-
- my $forlibrarian = 1; # are we in staff or opac?
- my $frameworkcode = GetFrameworkCode($biblionumber);
-
- my $authorised_values;
-
- my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode )
- or return $authorised_values;
-
- # assume that these entries in the authorised_value table are bibliolevel.
- # ones that start with 'item%' are item level.
- my $query = q(SELECT distinct authorised_value, kohafield
- FROM marc_subfield_structure
- WHERE authorised_value !=''
- AND (kohafield like 'biblio%'
- OR kohafield like '') );
- my $bibliolevel_authorised_values = C4::Context->dbh->selectall_hashref( $query, 'authorised_value' );
-
- foreach my $tag ( keys(%$tagslib) ) {
- foreach my $subfield ( keys( %{ $tagslib->{$tag} } ) ) {
-
- # warn "checking $subfield. type is: " . ref $tagslib->{ $tag }{ $subfield };
- if ( 'HASH' eq ref $tagslib->{$tag}{$subfield} ) {
- if ( defined $tagslib->{$tag}{$subfield}{'authorised_value'} && exists $bibliolevel_authorised_values->{ $tagslib->{$tag}{$subfield}{'authorised_value'} } ) {
- if ( defined $record->field($tag) ) {
- my $this_subfield_value = $record->field($tag)->subfield($subfield);
- if ( defined $this_subfield_value ) {
- $authorised_values->{ $tagslib->{$tag}{$subfield}{'authorised_value'} } = $this_subfield_value;
- }
- }
- }
- }
- }
- }
-
- # warn ( Data::Dumper->Dump( [ $authorised_values ], [ 'authorised_values' ] ) );
- return $authorised_values;
-}
-
=head2 CountBiblioInOrders
$count = &CountBiblioInOrders( $biblionumber);
return @resultitems;
}
-=head3 get_item_authorised_values
-
-find the types and values for all authorised values assigned to this item.
-
-parameters: itemnumber
-
-returns: a hashref malling the authorised value to the value set for this itemnumber
-
- $authorised_values = {
- 'CCODE' => undef,
- 'DAMAGED' => '0',
- 'LOC' => '3',
- 'LOST' => '0'
- 'NOT_LOAN' => '0',
- 'RESTRICTED' => undef,
- 'STACK' => undef,
- 'WITHDRAWN' => '0',
- 'branches' => 'CPL',
- 'cn_source' => undef,
- 'itemtypes' => 'SER',
- };
-
-Notes: see C4::Biblio::get_biblio_authorised_values for a similar method at the biblio level.
-
-=cut
-
-sub get_item_authorised_values {
- my $itemnumber = shift;
-
- # assume that these entries in the authorised_value table are item level.
- my $query = q(SELECT distinct authorised_value, kohafield
- FROM marc_subfield_structure
- WHERE kohafield like 'item%'
- AND authorised_value != '' );
-
- my $itemlevel_authorised_values = C4::Context->dbh->selectall_hashref( $query, 'authorised_value' );
- my $iteminfo = GetItem( $itemnumber );
- # warn( Data::Dumper->Dump( [ $itemlevel_authorised_values ], [ 'itemlevel_authorised_values' ] ) );
- my $return;
- foreach my $this_authorised_value ( keys %$itemlevel_authorised_values ) {
- my $field = $itemlevel_authorised_values->{ $this_authorised_value }->{'kohafield'};
- $field =~ s/^items\.//;
- if ( exists $iteminfo->{ $field } ) {
- $return->{ $this_authorised_value } = $iteminfo->{ $field };
- }
- }
- # warn( Data::Dumper->Dump( [ $return ], [ 'return' ] ) );
- return $return;
-}
-
-=head3 get_authorised_value_images
-
-find a list of icons that are appropriate for display based on the
-authorised values for a biblio.
-
-parameters: listref of authorised values, such as comes from
-get_item_authorised_values or
-from C4::Biblio::get_biblio_authorised_values
-
-returns: listref of hashrefs for each image. Each hashref looks like this:
-
- { imageurl => '/intranet-tmpl/prog/img/itemtypeimg/npl/WEB.gif',
- label => '',
- category => '',
- value => '', }
-
-Notes: Currently, I put on the full path to the images on the staff
-side. This should either be configurable or not done at all. Since I
-have to deal with 'intranet' or 'opac' in
-get_biblio_authorised_values, perhaps I should be passing it in.
-
-=cut
-
-sub get_authorised_value_images {
- my $authorised_values = shift;
-
- my @imagelist;
-
- my $authorised_value_list = GetAuthorisedValues();
- # warn ( Data::Dumper->Dump( [ $authorised_value_list ], [ 'authorised_value_list' ] ) );
- foreach my $this_authorised_value ( @$authorised_value_list ) {
- if ( exists $authorised_values->{ $this_authorised_value->{'category'} }
- && $authorised_values->{ $this_authorised_value->{'category'} } eq $this_authorised_value->{'authorised_value'} ) {
- # warn ( Data::Dumper->Dump( [ $this_authorised_value ], [ 'this_authorised_value' ] ) );
- if ( defined $this_authorised_value->{'imageurl'} ) {
- push @imagelist, { imageurl => C4::Koha::getitemtypeimagelocation( 'intranet', $this_authorised_value->{'imageurl'} ),
- label => $this_authorised_value->{'lib'},
- category => $this_authorised_value->{'category'},
- value => $this_authorised_value->{'authorised_value'}, };
- }
- }
- }
-
- # warn ( Data::Dumper->Dump( [ \@imagelist ], [ 'imagelist' ] ) );
- return \@imagelist;
-
-}
-
=head1 LIMITED USE FUNCTIONS
The following functions, while part of the public API,
# add imageurl to itemtype if there is one
$oldbiblio->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
- $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);
LetterLog
ReturnLog
SubscriptionLog
- AuthorisedValueImages
BiblioDefaultView
COinSinOPACResults
DisplayOPACiconsXSLT
SubscriptionHistory
Display856uAsImage
DisplayIconsXSLT
- StaffAuthorisedValueImages
template
yuipath
HidePatronName
('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'),
('SpineLabelFormat','<itemcallnumber><copynumber>','30|10','This preference defines the format for the quick spine label printer. Just list the fields you would like to see in the order you would like to see them, surrounded by <>, for example <itemcallnumber>.','Textarea'),
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
-('StaffAuthorisedValueImages','0',NULL,'','YesNo'),
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
class: multi
- (separate columns with |)
-
- - pref: AuthorisedValueImages
- 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 and item detail pages on the OPAC.
- -
- Use the image at
- pref: OpacFavicon
class: url
no: "Don't show"
- the format, audience, and material type icons in XSLT MARC21 results and detail pages in the staff client.
-
- - 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.
- -
- 'Display the URI in the 856u field as an image on: '
- pref: Display856uAsImage
choices:
</p>
[% IF ( SEARCH_RESULT.searchhighlightblob ) %]<p class="searchhighlightblob">[% SEARCH_RESULT.searchhighlightblob %]</p>[% END %]
- [% IF ( SEARCH_RESULT.authorised_value_images ) %]
- <p>
- [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
- <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.description %]" />
- [% END %]
- </p>
- [% END %]
-
[% END %]
[% END %]
<p class="hold">[% IF ( SEARCH_RESULT.norequests ) %]
</li>
<li>Use the Description field for the actual value that will be displayed. If you want something different to show in the OPAC, enter a 'Description (OPAC)'</li>
<li>If you would like to limit this authorized value category to only specific libraries you can choose them from the 'Branches limitation' menu. To have it show for all libraries just choose 'All branches' at the top of the list.</li>
- <li>If you have StaffAuthorisedValueImages and/or AuthorisedValueImages set to show images for authorized values you can choose the image under 'Choose an icon'</li>
</ul>
</li>
<li>Click 'Save'</li>
</li>
<li>Use the Description field for the actual value that will be displayed. If you want something different to show in the OPAC, enter a 'Description (OPAC)'</li>
<li>If you would like to limit this authorized value category to only specific libraries you can choose them from the 'Branches limitation' menu. To have it show for all libraries just choose 'All branches' at the top of the list.</li>
- <li>If you have StaffAuthorisedValueImages and/or AuthorisedValueImages set
-to show images for authorized values you can choose the image under 'Choose an icon'</li>
<li>Click 'Save'</li>
<li>The new value will appear in the list along with existing values</li>
</ul>
[% IF ( av_lib_include ) %]
<span class="item-status lost">[% av_lib_include %]</span>
[% ELSE %]
- [% IF ( item.lostimageurl ) %]
- <img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]" />
- [% ELSE %]
- <span class="item-status lost">Item lost</span>
- [% END %]
+ <span class="item-status lost">Item lost</span>
[% END %]
[% END %]
[% END # / IF MARCURLS %]
[% END # / IF OPACXSLTDetailsDisplay %]
- [% IF ( AuthorisedValueImages && authorised_value_images ) %]
- <div class="authorised_value_images">
- [% FOREACH authorised_value_image IN authorised_value_images %]
- <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]" />
- [% END %]
- </div>
- [% END # / AuthorisedValueImages && authorised_value_images %]
-
<!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
[% IF ( LibraryThingForLibrariesID ) %]
[% UNLESS ( LibraryThingForLibrariesTabbedView ) %]
</td>
[% END %]
- [% IF ( AuthorisedValueImages ) %]
- [% # Cell 4: Show Authorized value image %]
- <td class="authvalcol">
- [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
- [% IF ( authorised_value_image.imageurl ) %]
- <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]">
- [% END %]
- [% END %]
- </td>
- [% END %]
-
- [% # Cell 5: Search result details and controls %]
+ [% # Cell 4: Search result details and controls %]
<td class="bibliocol">
<div class="coverimages">
<a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
$dat->{'count'} = scalar(@items);
-my $biblio_authorised_value_images = C4::Context->preference('AuthorisedValueImages')
- ? C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) )
- : [];
-
my (%item_reserves, %priority);
my ($show_holds_count, $show_priority);
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
$itemfields{$_} = 1 if ($itm->{$_});
}
- # walk through the item-level authorised values and populate some images
- my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
- # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
-
- if ( $itm->{'itemlost'} ) {
- my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
- $itm->{'lostimageurl'} = $lostimageinfo->{ 'imageurl' };
- $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
- }
my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
itemdata_uri => $itemfields{uri},
itemdata_copynumber => $itemfields{copynumber},
itemdata_itemnotes => $itemfields{itemnotes},
- authorised_value_images => $biblio_authorised_value_images,
subtitle => $subtitle,
OpacStarRatings => C4::Context->preference("OpacStarRatings"),
);
LetterLog
ReturnLog
SubscriptionLog
- AuthorisedValueImages
BiblioDefaultView
COinSinOPACResults
DisplayOPACiconsXSLT
SubscriptionHistory
Display856uAsImage
DisplayIconsXSLT
- StaffAuthorisedValueImages
template
yuipath
HidePatronName