View | Details | Raw Unified | Return to bug 16167
Collapse All | Expand All

(-)a/C4/Auth.pm (-1 lines)
Lines 507-513 sub get_template_and_user { Link Here
507
        $template->param(
507
        $template->param(
508
            OpacAdditionalStylesheet                   => C4::Context->preference("OpacAdditionalStylesheet"),
508
            OpacAdditionalStylesheet                   => C4::Context->preference("OpacAdditionalStylesheet"),
509
            AnonSuggestions                       => "" . C4::Context->preference("AnonSuggestions"),
509
            AnonSuggestions                       => "" . C4::Context->preference("AnonSuggestions"),
510
            AuthorisedValueImages                 => C4::Context->preference("AuthorisedValueImages"),
511
            BranchesLoop                          => GetBranchesLoop($opac_name),
510
            BranchesLoop                          => GetBranchesLoop($opac_name),
512
            BranchCategoriesLoop                  => $library_categories,
511
            BranchCategoriesLoop                  => $library_categories,
513
            opac_name                             => $opac_name,
512
            opac_name                             => $opac_name,
(-)a/C4/Biblio.pm (-62 lines)
Lines 3470-3537 sub ModBiblioMarc { Link Here
3470
    return $biblionumber;
3470
    return $biblionumber;
3471
}
3471
}
3472
3472
3473
=head2 get_biblio_authorised_values
3474
3475
find the types and values for all authorised values assigned to this biblio.
3476
3477
parameters:
3478
    biblionumber
3479
    MARC::Record of the bib
3480
3481
returns: a hashref mapping the authorised value to the value set for this biblionumber
3482
3483
  $authorised_values = {
3484
                       'Scent'     => 'flowery',
3485
                       'Audience'  => 'Young Adult',
3486
                       'itemtypes' => 'SER',
3487
                        };
3488
3489
Notes: forlibrarian should probably be passed in, and called something different.
3490
3491
=cut
3492
3493
sub get_biblio_authorised_values {
3494
    my $biblionumber = shift;
3495
    my $record       = shift;
3496
3497
    my $forlibrarian  = 1;                                 # are we in staff or opac?
3498
    my $frameworkcode = GetFrameworkCode($biblionumber);
3499
3500
    my $authorised_values;
3501
3502
    my $tagslib = GetMarcStructure( $forlibrarian, $frameworkcode )
3503
      or return $authorised_values;
3504
3505
    # assume that these entries in the authorised_value table are bibliolevel.
3506
    # ones that start with 'item%' are item level.
3507
    my $query = q(SELECT distinct authorised_value, kohafield
3508
                    FROM marc_subfield_structure
3509
                    WHERE authorised_value !=''
3510
                      AND (kohafield like 'biblio%'
3511
                       OR  kohafield like '') );
3512
    my $bibliolevel_authorised_values = C4::Context->dbh->selectall_hashref( $query, 'authorised_value' );
3513
3514
    foreach my $tag ( keys(%$tagslib) ) {
3515
        foreach my $subfield ( keys( %{ $tagslib->{$tag} } ) ) {
3516
3517
            # warn "checking $subfield. type is: " . ref $tagslib->{ $tag }{ $subfield };
3518
            if ( 'HASH' eq ref $tagslib->{$tag}{$subfield} ) {
3519
                if ( defined $tagslib->{$tag}{$subfield}{'authorised_value'} && exists $bibliolevel_authorised_values->{ $tagslib->{$tag}{$subfield}{'authorised_value'} } ) {
3520
                    if ( defined $record->field($tag) ) {
3521
                        my $this_subfield_value = $record->field($tag)->subfield($subfield);
3522
                        if ( defined $this_subfield_value ) {
3523
                            $authorised_values->{ $tagslib->{$tag}{$subfield}{'authorised_value'} } = $this_subfield_value;
3524
                        }
3525
                    }
3526
                }
3527
            }
3528
        }
3529
    }
3530
3531
    # warn ( Data::Dumper->Dump( [ $authorised_values ], [ 'authorised_values' ] ) );
3532
    return $authorised_values;
3533
}
3534
3535
=head2 CountBiblioInOrders
3473
=head2 CountBiblioInOrders
3536
3474
3537
    $count = &CountBiblioInOrders( $biblionumber);
3475
    $count = &CountBiblioInOrders( $biblionumber);
(-)a/C4/Items.pm (-98 lines)
Lines 1760-1863 sub GetHiddenItemnumbers { Link Here
1760
    return @resultitems;
1760
    return @resultitems;
1761
}
1761
}
1762
1762
1763
=head3 get_item_authorised_values
1764
1765
find the types and values for all authorised values assigned to this item.
1766
1767
parameters: itemnumber
1768
1769
returns: a hashref malling the authorised value to the value set for this itemnumber
1770
1771
    $authorised_values = {
1772
             'CCODE'      => undef,
1773
             'DAMAGED'    => '0',
1774
             'LOC'        => '3',
1775
             'LOST'       => '0'
1776
             'NOT_LOAN'   => '0',
1777
             'RESTRICTED' => undef,
1778
             'STACK'      => undef,
1779
             'WITHDRAWN'  => '0',
1780
             'branches'   => 'CPL',
1781
             'cn_source'  => undef,
1782
             'itemtypes'  => 'SER',
1783
           };
1784
1785
Notes: see C4::Biblio::get_biblio_authorised_values for a similar method at the biblio level.
1786
1787
=cut
1788
1789
sub get_item_authorised_values {
1790
    my $itemnumber = shift;
1791
1792
    # assume that these entries in the authorised_value table are item level.
1793
    my $query = q(SELECT distinct authorised_value, kohafield
1794
                    FROM marc_subfield_structure
1795
                    WHERE kohafield like 'item%'
1796
                      AND authorised_value != '' );
1797
1798
    my $itemlevel_authorised_values = C4::Context->dbh->selectall_hashref( $query, 'authorised_value' );
1799
    my $iteminfo = GetItem( $itemnumber );
1800
    # warn( Data::Dumper->Dump( [ $itemlevel_authorised_values ], [ 'itemlevel_authorised_values' ] ) );
1801
    my $return;
1802
    foreach my $this_authorised_value ( keys %$itemlevel_authorised_values ) {
1803
        my $field = $itemlevel_authorised_values->{ $this_authorised_value }->{'kohafield'};
1804
        $field =~ s/^items\.//;
1805
        if ( exists $iteminfo->{ $field } ) {
1806
            $return->{ $this_authorised_value } = $iteminfo->{ $field };
1807
        }
1808
    }
1809
    # warn( Data::Dumper->Dump( [ $return ], [ 'return' ] ) );
1810
    return $return;
1811
}
1812
1813
=head3 get_authorised_value_images
1814
1815
find a list of icons that are appropriate for display based on the
1816
authorised values for a biblio.
1817
1818
parameters: listref of authorised values, such as comes from
1819
get_item_authorised_values or
1820
from C4::Biblio::get_biblio_authorised_values
1821
1822
returns: listref of hashrefs for each image. Each hashref looks like this:
1823
1824
      { imageurl => '/intranet-tmpl/prog/img/itemtypeimg/npl/WEB.gif',
1825
        label    => '',
1826
        category => '',
1827
        value    => '', }
1828
1829
Notes: Currently, I put on the full path to the images on the staff
1830
side. This should either be configurable or not done at all. Since I
1831
have to deal with 'intranet' or 'opac' in
1832
get_biblio_authorised_values, perhaps I should be passing it in.
1833
1834
=cut
1835
1836
sub get_authorised_value_images {
1837
    my $authorised_values = shift;
1838
1839
    my @imagelist;
1840
1841
    my $authorised_value_list = GetAuthorisedValues();
1842
    # warn ( Data::Dumper->Dump( [ $authorised_value_list ], [ 'authorised_value_list' ] ) );
1843
    foreach my $this_authorised_value ( @$authorised_value_list ) {
1844
        if ( exists $authorised_values->{ $this_authorised_value->{'category'} }
1845
             && $authorised_values->{ $this_authorised_value->{'category'} } eq $this_authorised_value->{'authorised_value'} ) {
1846
            # warn ( Data::Dumper->Dump( [ $this_authorised_value ], [ 'this_authorised_value' ] ) );
1847
            if ( defined $this_authorised_value->{'imageurl'} ) {
1848
                push @imagelist, { imageurl => C4::Koha::getitemtypeimagelocation( 'intranet', $this_authorised_value->{'imageurl'} ),
1849
                                   label    => $this_authorised_value->{'lib'},
1850
                                   category => $this_authorised_value->{'category'},
1851
                                   value    => $this_authorised_value->{'authorised_value'}, };
1852
            }
1853
        }
1854
    }
1855
1856
    # warn ( Data::Dumper->Dump( [ \@imagelist ], [ 'imagelist' ] ) );
1857
    return \@imagelist;
1858
1859
}
1860
1861
=head1 LIMITED USE FUNCTIONS
1763
=head1 LIMITED USE FUNCTIONS
1862
1764
1863
The following functions, while part of the public API,
1765
The following functions, while part of the public API,
(-)a/C4/Search.pm (-1 lines)
Lines 1896-1902 sub searchResults { Link Here
1896
        # add imageurl to itemtype if there is one
1896
        # add imageurl to itemtype if there is one
1897
        $oldbiblio->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
1897
        $oldbiblio->{imageurl} = getitemtypeimagelocation( $search_context, $itemtypes{ $oldbiblio->{itemtype} }->{imageurl} );
1898
1898
1899
        $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 ) ) : [];
1900
		$oldbiblio->{normalized_upc}  = GetNormalizedUPC(       $marcrecord,$marcflavour);
1899
		$oldbiblio->{normalized_upc}  = GetNormalizedUPC(       $marcrecord,$marcflavour);
1901
		$oldbiblio->{normalized_ean}  = GetNormalizedEAN(       $marcrecord,$marcflavour);
1900
		$oldbiblio->{normalized_ean}  = GetNormalizedEAN(       $marcrecord,$marcflavour);
1902
		$oldbiblio->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord,$marcflavour);
1901
		$oldbiblio->{normalized_oclc} = GetNormalizedOCLCNumber($marcrecord,$marcflavour);
(-)a/C4/UsageStats.pm (-2 lines)
Lines 217-223 sub BuildReport { Link Here
217
        LetterLog
217
        LetterLog
218
        ReturnLog
218
        ReturnLog
219
        SubscriptionLog
219
        SubscriptionLog
220
        AuthorisedValueImages
221
        BiblioDefaultView
220
        BiblioDefaultView
222
        COinSinOPACResults
221
        COinSinOPACResults
223
        DisplayOPACiconsXSLT
222
        DisplayOPACiconsXSLT
Lines 312-318 sub BuildReport { Link Here
312
        SubscriptionHistory
311
        SubscriptionHistory
313
        Display856uAsImage
312
        Display856uAsImage
314
        DisplayIconsXSLT
313
        DisplayIconsXSLT
315
        StaffAuthorisedValueImages
316
        template
314
        template
317
        yuipath
315
        yuipath
318
        HidePatronName
316
        HidePatronName
(-)a/admin/authorised_values.pl (-7 lines)
Lines 83-94 if ($op eq 'add_form') { Link Here
83
            lib              => $av->lib,
83
            lib              => $av->lib,
84
            lib_opac         => $av->lib_opac,
84
            lib_opac         => $av->lib_opac,
85
            id               => $av->id,
85
            id               => $av->id,
86
            imagesets        => C4::Koha::getImageSets( checked => $av->imageurl ),
87
        );
86
        );
88
    } else {
87
    } else {
89
        $template->param(
88
        $template->param(
90
            category  => $category,
89
            category  => $category,
91
            imagesets => C4::Koha::getImageSets(),
92
        );
90
        );
93
    }
91
    }
94
    $template->param(
92
    $template->param(
Lines 98-105 if ($op eq 'add_form') { Link Here
98
} elsif ($op eq 'add') {
96
} elsif ($op eq 'add') {
99
    my $new_authorised_value = $input->param('authorised_value');
97
    my $new_authorised_value = $input->param('authorised_value');
100
    my $new_category = $input->param('category');
98
    my $new_category = $input->param('category');
101
    my $imageurl     = $input->param( 'imageurl' ) || '';
102
    $imageurl = '' if $imageurl =~ /removeImage/;
103
    my $duplicate_entry = 0;
99
    my $duplicate_entry = 0;
104
    my @branches = grep { $_ ne q{} } $input->param('branches');
100
    my @branches = grep { $_ ne q{} } $input->param('branches');
105
101
Lines 120-126 if ($op eq 'add_form') { Link Here
120
        $av->lib_opac( $input->param('lib_opac') || undef );
116
        $av->lib_opac( $input->param('lib_opac') || undef );
121
        $av->category( $new_category );
117
        $av->category( $new_category );
122
        $av->authorised_value( $new_authorised_value );
118
        $av->authorised_value( $new_authorised_value );
123
        $av->imageurl( $imageurl );
124
        eval{
119
        eval{
125
            $av->store;
120
            $av->store;
126
            $av->replace_branch_limitations( \@branches );
121
            $av->replace_branch_limitations( \@branches );
Lines 137-143 if ($op eq 'add_form') { Link Here
137
            authorised_value => $new_authorised_value,
132
            authorised_value => $new_authorised_value,
138
            lib => $input->param('lib') || undef,
133
            lib => $input->param('lib') || undef,
139
            lib_opac => $input->param('lib_opac') || undef,
134
            lib_opac => $input->param('lib_opac') || undef,
140
            imageurl => $imageurl,
141
        } );
135
        } );
142
136
143
        eval {
137
        eval {
Lines 202-208 if ( $op eq 'list' ) { Link Here
202
        $row_data{authorised_value}      = $av->authorised_value;
196
        $row_data{authorised_value}      = $av->authorised_value;
203
        $row_data{lib}                   = $av->lib;
197
        $row_data{lib}                   = $av->lib;
204
        $row_data{lib_opac}              = $av->lib_opac;
198
        $row_data{lib_opac}              = $av->lib_opac;
205
        $row_data{imageurl}              = getitemtypeimagelocation( 'intranet', $av->imageurl );
206
        $row_data{branches}              = $av->branch_limitations;
199
        $row_data{branches}              = $av->branch_limitations;
207
        $row_data{id}                    = $av->id;
200
        $row_data{id}                    = $av->id;
208
        push(@loop_data, \%row_data);
201
        push(@loop_data, \%row_data);
(-)a/installer/data/mysql/sysprefs.sql (-1 lines)
Lines 439-445 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
439
('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'),
439
('SpineLabelAutoPrint','0','','If this setting is turned on, a print dialog will automatically pop up for the quick spine label printer.','YesNo'),
440
('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'),
440
('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'),
441
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
441
('SpineLabelShowPrintOnBibDetails','0','','If turned on, a \"Print Label\" link will appear for each item on the bib details page in the staff interface.','YesNo'),
442
('StaffAuthorisedValueImages','0',NULL,'','YesNo'),
443
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
442
('staffClientBaseURL','',NULL,'Specify the base URL of the staff client','free'),
444
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
443
('StaffDetailItemSelection', '1', NULL, 'Enable item selection in record detail page', 'YesNo'),
445
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
444
('StaffSearchResultsDisplayBranch','holdingbranch','holdingbranch|homebranch','Controls the display of the home or holding branch for staff search results','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt (-36 lines)
Lines 118-157 $(document).ready(function() { Link Here
118
        </li>
118
        </li>
119
119
120
		</ol>
120
		</ol>
121
        <div id="icons" class="toptabs" style="clear:both">
122
        <h5 style="margin-left:10px;">Choose an icon:</h5>
123
			<ul>
124
                  <li><a href="#none">None</a></li>
125
				  [% FOREACH imageset IN imagesets %]
126
                        [% IF ( imageset.imagesetactive ) %]<li class="ui-tabs-active">[% ELSE %]<li>[% END %]<a href="#[% imageset.imagesetname %]">[% imageset.imagesetname %]</a></li>
127
				  [% END %]
128
			</ul>
129
  <div id="none"><ul>
130
  <li><label for="noimage">No image: </label><input type="radio" name="imageurl" id="noimage" value="removeImage" /></li>
131
  </ul>
132
  <br class="clear" /></div>
133
  [% FOREACH imageset IN imagesets %]
134
  <div id="[% imageset.imagesetname %]"><ul>
135
  [% FOREACH image IN imageset.images %]
136
			<li style="float: none; display: inline-block; clear : none; width: auto;">
137
            <label> [% IF ( image.StaffImageUrl ) %]
138
              <img src="[% image.StaffImageUrl %]" alt="[% image.StaffImageUrl %]" title="[% image.StaffImageUrl %]" />
139
        [% ELSE %]
140
        [% END %]
141
    [% IF ( image.checked ) %]
142
              <input type="radio" name="imageurl" value="[% image.KohaImage %]" checked="checked" />
143
    [% ELSE %]
144
              [% IF ( image.KohaImage ) %] <!-- to delete the radio button if there is no image after -->
145
              <input type="radio" name="imageurl" value="[% image.KohaImage %]" />
146
              [% END %]
147
    [% END %]
148
            </label>
149
			</li>
150
  [% END %]</ul>
151
  <br class="clear" />
152
  </div>
153
  [% END %]
154
  </div>
155
        </fieldset>
121
        </fieldset>
156
       <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
122
       <fieldset class="action"> <input type="hidden" name="id" value="[% id %]" />
157
        <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
123
        <input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/admin/authorised_values.pl?searchfield=[% category %]">Cancel</a></fieldset>
Lines 250-256 $(document).ready(function() { Link Here
250
	<th>Authorized value</th>
216
	<th>Authorized value</th>
251
	<th>Description</th>
217
	<th>Description</th>
252
	<th>Description (OPAC)</th>
218
	<th>Description (OPAC)</th>
253
	<th>Icon</th>
254
    <th>Branches limitations</th>
219
    <th>Branches limitations</th>
255
	<th>Edit</th>
220
	<th>Edit</th>
256
	<th>Delete</th>
221
	<th>Delete</th>
Lines 265-271 $(document).ready(function() { Link Here
265
	<td>[% loo.authorised_value %]</td>
230
	<td>[% loo.authorised_value %]</td>
266
	<td>[% loo.lib %]</td>
231
	<td>[% loo.lib %]</td>
267
	<td>[% loo.lib_opac %]</td>
232
	<td>[% loo.lib_opac %]</td>
268
	<td>[% IF ( loo.imageurl ) %]<img src="[% loo.imageurl %]" alt=""/>[% ELSE %]&nbsp;[% END %]</td>
269
    <td>
233
    <td>
270
        [% IF loo.branches.size > 0 %]
234
        [% IF loo.branches.size > 0 %]
271
            [% branches_str = "" %]
235
            [% branches_str = "" %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (-6 lines)
Lines 176-187 OPAC: Link Here
176
              class: multi
176
              class: multi
177
            - (separate columns with |)
177
            - (separate columns with |)
178
        -
178
        -
179
            - pref: AuthorisedValueImages
180
              choices:
181
                  yes: Show
182
                  no: "Don't show"
183
            - 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.
184
        -
185
            - Use the image at
179
            - Use the image at
186
            - pref: OpacFavicon
180
            - pref: OpacFavicon
187
              class: url
181
              class: url
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_client.pref (-6 lines)
Lines 72-83 Staff Client: Link Here
72
                  no: "Don't show"
72
                  no: "Don't show"
73
            - the format, audience, and material type icons in XSLT MARC21 results and detail pages in the staff client.
73
            - the format, audience, and material type icons in XSLT MARC21 results and detail pages in the staff client.
74
        -
74
        -
75
            - pref: StaffAuthorisedValueImages
76
              choices:
77
                  yes: Show
78
                  no: "Don't show"
79
            - images for <a href="/cgi-bin/koha/admin/authorised_values.pl">authorized values</a> (such as lost statuses and locations) in search results.
80
        -
81
            - 'Display the URI in the 856u field as an image on: '
75
            - 'Display the URI in the 856u field as an image on: '
82
            - pref: Display856uAsImage
76
            - pref: Display856uAsImage
83
              choices:
77
              choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-8 lines)
Lines 551-564 var holdForPatron = function () { Link Here
551
                                    </p>
551
                                    </p>
552
                                    [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<p class="searchhighlightblob">[% SEARCH_RESULT.searchhighlightblob %]</p>[% END %]
552
                                    [% IF ( SEARCH_RESULT.searchhighlightblob ) %]<p class="searchhighlightblob">[% SEARCH_RESULT.searchhighlightblob %]</p>[% END %]
553
553
554
                                    [% IF ( SEARCH_RESULT.authorised_value_images ) %]
555
                                <p>
556
                                  [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
557
                                  <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.description %]" />
558
                                  [% END %]
559
                                </p>
560
                                [% END %]
561
562
                                [% END %]
554
                                [% END %]
563
                                [% END %]
555
                                [% END %]
564
                                  <p class="hold">[% IF ( SEARCH_RESULT.norequests ) %]
556
                                  <p class="hold">[% IF ( SEARCH_RESULT.norequests ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/help/admin/authorised_values.tt (-3 lines)
Lines 63-69 Link Here
63
</li>
63
</li>
64
	<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>
64
	<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>
65
	<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>
65
	<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>
66
	<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>
67
</ul>
66
</ul>
68
</li>
67
</li>
69
	<li>Click 'Save'</li>
68
	<li>Click 'Save'</li>
Lines 85-92 Link Here
85
</li>
84
</li>
86
	<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>
85
	<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>
87
	<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>
86
	<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>
88
	<li>If you have StaffAuthorisedValueImages and/or AuthorisedValueImages set
89
to show images for authorized values you can choose the image under 'Choose an icon'</li>
90
	<li>Click 'Save'</li>
87
	<li>Click 'Save'</li>
91
	<li>The new value will appear in the list along with existing values</li>
88
	<li>The new value will appear in the list along with existing values</li>
92
</ul>
89
</ul>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc (-5 / +1 lines)
Lines 14-24 not use an API to fetch items that populates item.datedue. Link Here
14
    [% IF ( av_lib_include ) %]
14
    [% IF ( av_lib_include ) %]
15
        <span class="item-status lost">[% av_lib_include %]</span>
15
        <span class="item-status lost">[% av_lib_include %]</span>
16
    [% ELSE %]
16
    [% ELSE %]
17
        [% IF ( item.lostimageurl ) %]
17
        <span class="item-status lost">Item lost</span>
18
            <img src="[% item.lostimageurl %]" alt="[% item.lostimagelabel %]" title="[% item.lostimagelabel %]" />
19
        [% ELSE %]
20
            <span class="item-status lost">Item lost</span>
21
        [% END %]
22
    [% END %]
18
    [% END %]
23
[% END %]
19
[% END %]
24
20
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt (-8 lines)
Lines 363-376 Link Here
363
                        [% END # / IF MARCURLS %]
363
                        [% END # / IF MARCURLS %]
364
                    [% END # / IF OPACXSLTDetailsDisplay %]
364
                    [% END # / IF OPACXSLTDetailsDisplay %]
365
365
366
                    [% IF ( AuthorisedValueImages && authorised_value_images ) %]
367
                        <div class="authorised_value_images">
368
                            [% FOREACH authorised_value_image IN authorised_value_images %]
369
                                <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]" />
370
                            [% END %]
371
                        </div>
372
                    [% END # / AuthorisedValueImages && authorised_value_images %]
373
374
                    <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
366
                    <!-- This puts the LTFL reviews in, and if TabbedView is not set, puts the remaining content above the Tabs instead of in them -->
375
                    [% IF ( LibraryThingForLibrariesID ) %]
367
                    [% IF ( LibraryThingForLibrariesID ) %]
376
                        [% UNLESS ( LibraryThingForLibrariesTabbedView ) %]
368
                        [% UNLESS ( LibraryThingForLibrariesTabbedView ) %]
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt (-12 / +1 lines)
Lines 220-237 Link Here
220
                                                </td>
220
                                                </td>
221
                                            [% END %]
221
                                            [% END %]
222
222
223
                                            [% IF ( AuthorisedValueImages ) %]
223
                                            [% # Cell 4: Search result details and controls %]
224
                                                [% # Cell 4: Show Authorized value image %]
225
                                                <td class="authvalcol">
226
                                                    [% FOREACH authorised_value_image IN SEARCH_RESULT.authorised_value_images %]
227
                                                        [% IF ( authorised_value_image.imageurl ) %]
228
                                                            <img src="[% authorised_value_image.imageurl %]" alt="[% authorised_value_image.label %]" title="[% authorised_value_image.label %]">
229
                                                        [% END %]
230
                                                    [% END %]
231
                                                </td>
232
                                            [% END %]
233
234
                                            [% # Cell 5: Search result details and controls %]
235
                                            <td class="bibliocol">
224
                                            <td class="bibliocol">
236
                                                <div class="coverimages">
225
                                                <div class="coverimages">
237
                                                    <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
226
                                                    <a class="p1" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% SEARCH_RESULT.biblionumber %]">
(-)a/opac/opac-detail.pl (-14 lines)
Lines 560-569 foreach my $subscription (@subscriptions) { Link Here
560
$dat->{'count'} = scalar(@items);
560
$dat->{'count'} = scalar(@items);
561
561
562
562
563
my $biblio_authorised_value_images = C4::Context->preference('AuthorisedValueImages')
564
    ? C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) )
565
    : [];
566
567
my (%item_reserves, %priority);
563
my (%item_reserves, %priority);
568
my ($show_holds_count, $show_priority);
564
my ($show_holds_count, $show_priority);
569
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
565
for ( C4::Context->preference("OPACShowHoldQueueDetails") ) {
Lines 656-670 if ( not $viewallitems and @items > $max_items_to_display ) { Link Here
656
        $itemfields{$_} = 1 if ($itm->{$_});
652
        $itemfields{$_} = 1 if ($itm->{$_});
657
    }
653
    }
658
654
659
     # walk through the item-level authorised values and populate some images
660
     my $item_authorised_value_images = C4::Items::get_authorised_value_images( C4::Items::get_item_authorised_values( $itm->{'itemnumber'} ) );
661
     # warn( Data::Dumper->Dump( [ $item_authorised_value_images ], [ 'item_authorised_value_images' ] ) );
662
663
     if ( $itm->{'itemlost'} ) {
664
         my $lostimageinfo = List::Util::first { $_->{'category'} eq 'LOST' } @$item_authorised_value_images;
665
         $itm->{'lostimageurl'}   = $lostimageinfo->{ 'imageurl' };
666
         $itm->{'lostimagelabel'} = $lostimageinfo->{ 'label' };
667
     }
668
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
655
     my $reserve_status = C4::Reserves::GetReserveStatus($itm->{itemnumber});
669
      if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
656
      if( $reserve_status eq "Waiting"){ $itm->{'waiting'} = 1; }
670
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
657
      if( $reserve_status eq "Reserved"){ $itm->{'onhold'} = 1; }
Lines 736-742 my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib Link Here
736
                     itemdata_uri            => $itemfields{uri},
723
                     itemdata_uri            => $itemfields{uri},
737
                     itemdata_copynumber     => $itemfields{copynumber},
724
                     itemdata_copynumber     => $itemfields{copynumber},
738
                     itemdata_itemnotes          => $itemfields{itemnotes},
725
                     itemdata_itemnotes          => $itemfields{itemnotes},
739
                     authorised_value_images => $biblio_authorised_value_images,
740
                     subtitle                => $subtitle,
726
                     subtitle                => $subtitle,
741
                     OpacStarRatings         => C4::Context->preference("OpacStarRatings"),
727
                     OpacStarRatings         => C4::Context->preference("OpacStarRatings"),
742
    );
728
    );
(-)a/t/db_dependent/UsageStats.t (-3 lines)
Lines 468-474 sub mocking_systempreferences_to_a_set_value { Link Here
468
        LetterLog
468
        LetterLog
469
        ReturnLog
469
        ReturnLog
470
        SubscriptionLog
470
        SubscriptionLog
471
        AuthorisedValueImages
472
        BiblioDefaultView
471
        BiblioDefaultView
473
        COinSinOPACResults
472
        COinSinOPACResults
474
        DisplayOPACiconsXSLT
473
        DisplayOPACiconsXSLT
Lines 564-570 sub mocking_systempreferences_to_a_set_value { Link Here
564
        SubscriptionHistory
563
        SubscriptionHistory
565
        Display856uAsImage
564
        Display856uAsImage
566
        DisplayIconsXSLT
565
        DisplayIconsXSLT
567
        StaffAuthorisedValueImages
568
        template
566
        template
569
        yuipath
567
        yuipath
570
        HidePatronName
568
        HidePatronName
571
- 

Return to bug 16167