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

(-)a/C4/Biblio.pm (+5 lines)
Lines 97-102 use C4::Debug; Link Here
97
97
98
use Koha::Caches;
98
use Koha::Caches;
99
use Koha::Authority::Types;
99
use Koha::Authority::Types;
100
use Koha::Acquisition::Booksellers;
100
use Koha::Acquisition::Currencies;
101
use Koha::Acquisition::Currencies;
101
use Koha::Biblio::Metadatas;
102
use Koha::Biblio::Metadatas;
102
use Koha::Holds;
103
use Koha::Holds;
Lines 1362-1367 descriptions rather than normal ones when they exist. Link Here
1362
sub GetAuthorisedValueDesc {
1363
sub GetAuthorisedValueDesc {
1363
    my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_;
1364
    my ( $tag, $subfield, $value, $framework, $tagslib, $category, $opac ) = @_;
1364
1365
1366
    if ( $tagslib->{$tag}->{$subfield}->{kohafield} eq 'items.booksellerid' ) {
1367
        my $vendor = Koha::Acquisition::Booksellers->find($value);
1368
        return $vendor ? $vendor->name : $value;
1369
    }
1365
    if ( !$category ) {
1370
    if ( !$category ) {
1366
1371
1367
        return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'};
1372
        return $value unless defined $tagslib->{$tag}->{$subfield}->{'authorised_value'};
(-)a/cataloguing/additem.pl (-2 / +19 lines)
Lines 335-341 sub generate_subfield_form { Link Here
335
                id          => $subfield_data{id},
335
                id          => $subfield_data{id},
336
                value       => $value,
336
                value       => $value,
337
            };
337
            };
338
        } else {
338
        }
339
        elsif ($value && $subfieldlib->{kohafield} eq 'items.booksellerid' ) {
340
            # It's linked with items.booksellerid (expected for "Source of acquisition")
341
            my $vendors = Koha::Acquisition::Booksellers->search;
342
            my @authorised_values;
343
            my %authorised_lib;
344
            while ( my $vendor = $vendors->next ) {
345
                push @authorised_values, $vendor->id;
346
                $authorised_lib{$vendor->id} = $vendor->name;
347
            }
348
            $subfield_data{marc_value} = {
349
                type     => 'select',
350
                id       => "tag_".$tag."_subfield_".$subfieldtag."_".$index_subfield,
351
                values   => \@authorised_values,
352
                labels   => \%authorised_lib,
353
                default  => $value,
354
            };
355
        }
356
        else {
339
            # it's a standard field
357
            # it's a standard field
340
            $subfield_data{marc_value} = {
358
            $subfield_data{marc_value} = {
341
                type        => 'text',
359
                type        => 'text',
342
- 

Return to bug 8676