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

(-)a/C4/Biblio.pm (-19 / +30 lines)
Lines 68-73 BEGIN { Link Here
68
        TransformHtmlToMarc
68
        TransformHtmlToMarc
69
        TransformHtmlToXml
69
        TransformHtmlToXml
70
        prepare_host_field
70
        prepare_host_field
71
        SplitSubtitle
71
    );
72
    );
72
73
73
    # Internal functions
74
    # Internal functions
Lines 637-675 sub _check_valid_auth_link { Link Here
637
638
638
=head2 GetRecordValue
639
=head2 GetRecordValue
639
640
640
  my $values = GetRecordValue($field, $record, $frameworkcode);
641
  my $values = GetRecordValue($field, $record);
641
642
642
Get MARC fields from a keyword defined in fieldmapping table.
643
Get MARC fields from the record using the framework mappings for biblio fields.
643
644
644
=cut
645
=cut
645
646
646
sub GetRecordValue {
647
sub GetRecordValue {
647
    my ( $field, $record, $frameworkcode ) = @_;
648
    my ( $field, $record ) = @_;
648
649
649
    if (!$record) {
650
    if (!$record) {
650
        carp 'GetRecordValue called with undefined record';
651
        carp 'GetRecordValue called with undefined record';
651
        return;
652
        return;
652
    }
653
    }
653
    my $dbh = C4::Context->dbh;
654
655
    my $sth = $dbh->prepare('SELECT fieldcode, subfieldcode FROM fieldmapping WHERE frameworkcode = ? AND field = ?');
656
    $sth->execute( $frameworkcode, $field );
657
658
    my @result = ();
659
660
    while ( my $row = $sth->fetchrow_hashref ) {
661
        foreach my $field ( $record->field( $row->{fieldcode} ) ) {
662
            if ( ( $row->{subfieldcode} ne "" && $field->subfield( $row->{subfieldcode} ) ) ) {
663
                foreach my $subfield ( $field->subfield( $row->{subfieldcode} ) ) {
664
                    push @result, { 'subfield' => $subfield };
665
                }
666
654
667
            } elsif ( $row->{subfieldcode} eq "" ) {
655
    my @result;
668
                push @result, { 'subfield' => $field->as_string() };
656
    my @mss = GetMarcSubfieldStructureFromKohaField("biblio.$field");
657
    foreach my $fldhash ( @mss ) {
658
        my $tag = $fldhash->{tagfield};
659
        my $sub = $fldhash->{tagsubfield};
660
        foreach my $fld ( $record->field($tag) ) {
661
            if( $sub eq '@' || $fld->is_control_field ) {
662
                push @result, $fld->data if $fld->data;
663
            } else {
664
                push @result, grep { $_ } $fld->subfield($sub);
669
            }
665
            }
670
        }
666
        }
671
    }
667
    }
672
673
    return \@result;
668
    return \@result;
674
}
669
}
675
670
Lines 3616-3621 sub RemoveAllNsb { Link Here
3616
    return $record;
3611
    return $record;
3617
}
3612
}
3618
3613
3614
=head2 SplitSubtitle
3615
3616
    $subtitles = SplitSubtitle($subtitle);
3617
3618
Splits a subtitle field to an array of hashes like the one GetRecordValue returns
3619
3620
=cut
3621
3622
sub SplitSubtitle {
3623
    my $subtitle = shift;
3624
3625
    my @subtitles = map( { 'subfield' => $_ }, split(/ \| /, $subtitle // '' ) );
3626
3627
    return \@subtitles;
3628
}
3629
3619
1;
3630
1;
3620
3631
3621
3632
(-)a/C4/HoldsQueue.pm (-8 / +9 lines)
Lines 132-138 sub GetHoldsQueueItems { Link Here
132
    my $dbh   = C4::Context->dbh;
132
    my $dbh   = C4::Context->dbh;
133
133
134
    my @bind_params = ();
134
    my @bind_params = ();
135
    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, biblioitems.itemtype, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn,items.copynumber
135
    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, biblioitems.itemtype, items.location,
136
                         items.enumchron, items.cn_sort, biblioitems.publishercode,
137
                         biblio.copyrightdate, biblio.subtitle, biblio.part_number,
138
                         biblio.part_name,
139
                         biblioitems.publicationyear, biblioitems.pages, biblioitems.size, biblioitems.publicationyear,
140
                         biblioitems.isbn, items.copynumber
136
                  FROM tmp_holdsqueue
141
                  FROM tmp_holdsqueue
137
                       JOIN biblio      USING (biblionumber)
142
                       JOIN biblio      USING (biblionumber)
138
                  LEFT JOIN biblioitems USING (biblionumber)
143
                  LEFT JOIN biblioitems USING (biblionumber)
Lines 147-165 sub GetHoldsQueueItems { Link Here
147
    $sth->execute(@bind_params);
152
    $sth->execute(@bind_params);
148
    my $items = [];
153
    my $items = [];
149
    while ( my $row = $sth->fetchrow_hashref ){
154
    while ( my $row = $sth->fetchrow_hashref ){
150
        my $record = GetMarcBiblio({ biblionumber => $row->{biblionumber} });
151
        if ($record){
152
            $row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
153
            $row->{parts} = GetRecordValue('parts',$record,'')->[0]->{subfield};
154
            $row->{numbers} = GetRecordValue('numbers',$record,'')->[0]->{subfield};
155
        }
156
157
        # return the bib-level or item-level itype per syspref
155
        # return the bib-level or item-level itype per syspref
158
        if (!C4::Context->preference('item-level_itypes')) {
156
        if (!C4::Context->preference('item-level_itypes')) {
159
            $row->{itype} = $row->{itemtype};
157
            $row->{itype} = $row->{itemtype};
160
        }
158
        }
161
        delete $row->{itemtype};
159
        delete $row->{itemtype};
162
160
161
        my @subtitles = split(/ \| /, $row->{'subtitle'} // '' );
162
        $row->{'subtitle'} = \@subtitles;
163
163
        push @$items, $row;
164
        push @$items, $row;
164
    }
165
    }
165
    return $items;
166
    return $items;
(-)a/C4/Overdues.pm (+4 lines)
Lines 701-706 sub GetOverduesForBranch { Link Here
701
            borrowers.phone,
701
            borrowers.phone,
702
            borrowers.email,
702
            borrowers.email,
703
               biblio.title,
703
               biblio.title,
704
               biblio.subtitle,
705
               biblio.medium,
706
               biblio.part_number,
707
               biblio.part_name,
704
               biblio.author,
708
               biblio.author,
705
               biblio.biblionumber,
709
               biblio.biblionumber,
706
               issues.date_due,
710
               issues.date_due,
(-)a/C4/Search.pm (-1 / +1 lines)
Lines 1950-1956 sub searchResults { Link Here
1950
1950
1951
        SetUTF8Flag($marcrecord);
1951
        SetUTF8Flag($marcrecord);
1952
        my $oldbiblio = TransformMarcToKoha( $marcrecord, $fw );
1952
        my $oldbiblio = TransformMarcToKoha( $marcrecord, $fw );
1953
        $oldbiblio->{subtitle} = GetRecordValue('subtitle', $marcrecord, $fw);
1953
        $oldbiblio->{subtitle} = GetRecordValue('subtitle', $marcrecord);
1954
        $oldbiblio->{result_number} = $i + 1;
1954
        $oldbiblio->{result_number} = $i + 1;
1955
1955
1956
        # add imageurl to itemtype if there is one
1956
        # add imageurl to itemtype if there is one
(-)a/C4/ShelfBrowser.pm (-2 / +5 lines)
Lines 223-234 sub GetShelfInfo { Link Here
223
        my $this_biblio = GetBibData($item->{biblionumber});
223
        my $this_biblio = GetBibData($item->{biblionumber});
224
        next unless defined $this_biblio;
224
        next unless defined $this_biblio;
225
        $item->{'title'} = $this_biblio->{'title'};
225
        $item->{'title'} = $this_biblio->{'title'};
226
        $item->{'subtitle'} = C4::Biblio::SplitSubtitle($this_biblio->{'subtitle'}),
227
        $item->{'medium'} = $this_biblio->{'medium'};
228
        $item->{'part_number'} = $this_biblio->{'part_number'};
229
        $item->{'part_name'} = $this_biblio->{'part_name'};
226
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
230
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
227
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
231
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
228
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
232
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
229
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
233
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
230
        $item->{'browser_normalized_ean'} = GetNormalizedEAN($this_record,$marcflavour);
234
        $item->{'browser_normalized_ean'} = GetNormalizedEAN($this_record,$marcflavour);
231
        $item->{'subtitle'} = GetRecordValue('subtitle', $this_record, GetFrameworkCode( $item->{biblionumber} ));
232
        push @valid_items, $item;
235
        push @valid_items, $item;
233
    }
236
    }
234
    return @valid_items;
237
    return @valid_items;
Lines 239-245 sub GetBibData { Link Here
239
	my ($bibnum) = @_;
242
	my ($bibnum) = @_;
240
243
241
    my $dbh         = C4::Context->dbh;
244
    my $dbh         = C4::Context->dbh;
242
    my $sth = $dbh->prepare("SELECT biblionumber, title FROM biblio WHERE biblionumber=?");
245
    my $sth = $dbh->prepare("SELECT biblionumber, title, subtitle, medium, part_number, part_name FROM biblio WHERE biblionumber=?");
243
    $sth->execute($bibnum);
246
    $sth->execute($bibnum);
244
    my $bib = $sth->fetchrow_hashref();
247
    my $bib = $sth->fetchrow_hashref();
245
    return $bib;
248
    return $bib;
(-)a/Koha/Biblio.pm (-8 / +3 lines)
Lines 83-102 sub metadata { Link Here
83
83
84
my @subtitles = $biblio->subtitles();
84
my @subtitles = $biblio->subtitles();
85
85
86
Returns list of subtitles for a record.
86
Returns list of subtitles for a record according to the framework.
87
88
Keyword to MARC mapping for subtitle must be set for this method to return any possible values.
89
87
90
=cut
88
=cut
91
89
92
sub subtitles {
90
sub subtitles {
93
    my ( $self ) = @_;
91
    my ( $self ) = @_;
94
92
95
    return map { $_->{subfield} } @{
93
    my @subtitles = split( / \| /, $self->subtitle // '' );
96
        C4::Biblio::GetRecordValue(
94
    return @subtitles;
97
            'subtitle',
98
            C4::Biblio::GetMarcBiblio({ biblionumber => $self->id }),
99
            $self->frameworkcode ) };
100
}
95
}
101
96
102
=head3 can_article_request
97
=head3 can_article_request
(-)a/acqui/neworderbiblio.pl (-1 / +1 lines)
Lines 129-136 my @results; Link Here
129
foreach my $result ( @{$marcresults} ) {
129
foreach my $result ( @{$marcresults} ) {
130
    my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $result );
130
    my $marcrecord = C4::Search::new_record_from_zebra( 'biblioserver', $result );
131
    my $biblio = TransformMarcToKoha( $marcrecord, '' );
131
    my $biblio = TransformMarcToKoha( $marcrecord, '' );
132
    $biblio->{subtitles} = GetRecordValue( 'subtitle', GetMarcBiblio({ biblionumber => $biblio->{biblionumber} }),  GetFrameworkCode( $biblio->{biblionumber} ) );
133
132
133
    $biblio->{subtitles} = C4::Biblio::SplitSubtitle($biblio->{'subtitle'});
134
    $biblio->{booksellerid} = $booksellerid;
134
    $biblio->{booksellerid} = $booksellerid;
135
    push @results, $biblio;
135
    push @results, $biblio;
136
136
(-)a/basket/basket.pl (-3 / +1 lines)
Lines 59-70 if (C4::Context->preference('TagsEnabled')) { Link Here
59
foreach my $biblionumber ( @bibs ) {
59
foreach my $biblionumber ( @bibs ) {
60
    $template->param( biblionumber => $biblionumber );
60
    $template->param( biblionumber => $biblionumber );
61
61
62
    my $fw = GetFrameworkCode($biblionumber);
63
64
    my $dat              = &GetBiblioData($biblionumber);
62
    my $dat              = &GetBiblioData($biblionumber);
65
    next unless $dat;
63
    next unless $dat;
66
    my $record           = &GetMarcBiblio({ biblionumber => $biblionumber });
64
    my $record           = &GetMarcBiblio({ biblionumber => $biblionumber });
67
    $dat->{subtitle}     = GetRecordValue('subtitle', $record, $fw);
65
    $dat->{subtitle}     = GetRecordValue('subtitle', $record);
68
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
66
    my $marcnotesarray   = GetMarcNotes( $record, $marcflavour );
69
    my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
67
    my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
70
    my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
68
    my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
(-)a/catalogue/detail.pl (-1 / +1 lines)
Lines 141-147 my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour ); Link Here
141
my $marcseriesarray  = GetMarcSeries($record,$marcflavour);
141
my $marcseriesarray  = GetMarcSeries($record,$marcflavour);
142
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
142
my $marcurlsarray    = GetMarcUrls    ($record,$marcflavour);
143
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
143
my $marchostsarray  = GetMarcHosts($record,$marcflavour);
144
my $subtitle         = GetRecordValue('subtitle', $record, $fw);
144
my $subtitle         = GetRecordValue('subtitle', $record);
145
145
146
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
146
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search->unblessed } };
147
147
(-)a/catalogue/moredetail.pl (-1 / +1 lines)
Lines 110-116 if (@hostitems){ Link Here
110
        push (@items,@hostitems);
110
        push (@items,@hostitems);
111
}
111
}
112
112
113
my $subtitle = GetRecordValue('subtitle', $record, $fw);
113
my $subtitle = GetRecordValue('subtitle', $record);
114
114
115
my $totalcount=@all_items;
115
my $totalcount=@all_items;
116
my $showncount=@items;
116
my $showncount=@items;
(-)a/circ/branchoverdues.pl (-4 / +4 lines)
Lines 76-88 if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { Link Here
76
# now display infos
76
# now display infos
77
foreach my $num (@getoverdues) {
77
foreach my $num (@getoverdues) {
78
    my %overdueforbranch;
78
    my %overdueforbranch;
79
    my $record = GetMarcBiblio({ biblionumber => $num->{biblionumber} });
80
    if ($record){
81
        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
82
    }
83
    my $dt = dt_from_string($num->{date_due}, 'sql');
79
    my $dt = dt_from_string($num->{date_due}, 'sql');
84
    $overdueforbranch{'date_due'}          = output_pref($dt);
80
    $overdueforbranch{'date_due'}          = output_pref($dt);
85
    $overdueforbranch{'title'}             = $num->{'title'};
81
    $overdueforbranch{'title'}             = $num->{'title'};
82
    $overdueforbranch{'subtitle'}          = $num->{'subtitle'};
83
    $overdueforbranch{'medium'}            = $num->{'medium'};
84
    $overdueforbranch{'part_number'}       = $num->{'part_number'};
85
    $overdueforbranch{'part_name'}         = $num->{'part_name'};
86
    $overdueforbranch{'description'}       = $num->{'description'};
86
    $overdueforbranch{'description'}       = $num->{'description'};
87
    $overdueforbranch{'barcode'}           = $num->{'barcode'};
87
    $overdueforbranch{'barcode'}           = $num->{'barcode'};
88
    $overdueforbranch{'biblionumber'}      = $num->{'biblionumber'};
88
    $overdueforbranch{'biblionumber'}      = $num->{'biblionumber'};
(-)a/circ/pendingreserves.pl (-4 / +7 lines)
Lines 198-203 my $strsth = Link Here
198
            GROUP_CONCAT(DISTINCT items.copynumber
198
            GROUP_CONCAT(DISTINCT items.copynumber
199
                    ORDER BY items.itemnumber SEPARATOR '|') l_copynumber,
199
                    ORDER BY items.itemnumber SEPARATOR '|') l_copynumber,
200
            biblio.title,
200
            biblio.title,
201
            biblio.subtitle,
202
            biblio.medium,
203
            biblio.part_number,
204
            biblio.part_name,
201
            biblio.author,
205
            biblio.author,
202
            count(DISTINCT items.itemnumber) as icount,
206
            count(DISTINCT items.itemnumber) as icount,
203
            count(DISTINCT reserves.borrowernumber) as rcount,
207
            count(DISTINCT reserves.borrowernumber) as rcount,
Lines 235-244 my $sth = $dbh->prepare($strsth); Link Here
235
$sth->execute(@query_params);
239
$sth->execute(@query_params);
236
240
237
while ( my $data = $sth->fetchrow_hashref ) {
241
while ( my $data = $sth->fetchrow_hashref ) {
238
    my $record = Koha::Biblios->find($data->{biblionumber});
239
    if ($record){
240
        $data->{subtitle} = [ $record->subtitles ];
241
    }
242
    push(
242
    push(
243
        @reservedata, {
243
        @reservedata, {
244
            reservedate     => $data->{l_reservedate},
244
            reservedate     => $data->{l_reservedate},
Lines 246-251 while ( my $data = $sth->fetchrow_hashref ) { Link Here
246
            surname         => $data->{surname},
246
            surname         => $data->{surname},
247
            title           => $data->{title},
247
            title           => $data->{title},
248
            subtitle        => $data->{subtitle},
248
            subtitle        => $data->{subtitle},
249
            medium          => $data->{medium},
250
            part_number     => $data->{part_number},
251
            part_name       => $data->{part_name},
249
            author          => $data->{author},
252
            author          => $data->{author},
250
            borrowernumber  => $data->{borrowernumber},
253
            borrowernumber  => $data->{borrowernumber},
251
            biblionumber    => $data->{biblionumber},
254
            biblionumber    => $data->{biblionumber},
(-)a/circ/reserveratios.pl (-4 / +5 lines)
Lines 27-33 use C4::Context; Link Here
27
use C4::Output;
27
use C4::Output;
28
use C4::Auth;
28
use C4::Auth;
29
use C4::Debug;
29
use C4::Debug;
30
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/;
31
use C4::Acquisition qw/GetOrdersByBiblionumber/;
30
use C4::Acquisition qw/GetOrdersByBiblionumber/;
32
use Koha::DateUtils;
31
use Koha::DateUtils;
33
use Koha::Acquisition::Baskets;
32
use Koha::Acquisition::Baskets;
Lines 125-130 my $strsth = Link Here
125
124
126
        reserves.found,
125
        reserves.found,
127
        biblio.title,
126
        biblio.title,
127
        biblio.subtitle,
128
        biblio.medium,
129
        biblio.part_number,
130
        biblio.part_name,
128
        biblio.author,
131
        biblio.author,
129
        count(DISTINCT reserves.borrowernumber) as reservecount, 
132
        count(DISTINCT reserves.borrowernumber) as reservecount, 
130
        count(DISTINCT items.itemnumber) $include_aqorders_qty as itemcount
133
        count(DISTINCT items.itemnumber) $include_aqorders_qty as itemcount
Lines 154-161 while ( my $data = $sth->fetchrow_hashref ) { Link Here
154
    my $thisratio = $data->{reservecount} / $data->{itemcount};
157
    my $thisratio = $data->{reservecount} / $data->{itemcount};
155
    my $ratiocalc = ($thisratio / $ratio);
158
    my $ratiocalc = ($thisratio / $ratio);
156
    ($thisratio / $ratio) >= 1 or next;  # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
159
    ($thisratio / $ratio) >= 1 or next;  # TODO: tighter targeting -- get ratio limit into SQL using HAVING clause
157
    my $record = GetMarcBiblio({ biblionumber => $data->{biblionumber} });
158
    $data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
159
    push(
160
    push(
160
        @reservedata,
161
        @reservedata,
161
        {
162
        {
Lines 163-169 while ( my $data = $sth->fetchrow_hashref ) { Link Here
163
            priority           => $data->{priority},
164
            priority           => $data->{priority},
164
            name               => $data->{borrower},
165
            name               => $data->{borrower},
165
            title              => $data->{title},
166
            title              => $data->{title},
166
            subtitle           => $data->{subtitle},
167
            subtitle           => C4::Biblio::SplitSubtitle($data->{'subtitle'});
167
            author             => $data->{author},
168
            author             => $data->{author},
168
            itemnum            => $data->{itemnumber},
169
            itemnum            => $data->{itemnumber},
169
            biblionumber       => $data->{biblionumber},
170
            biblionumber       => $data->{biblionumber},
(-)a/circ/transferstoreceive.pl (-3 / +4 lines)
Lines 99-104 while ( my $library = $libraries->next ) { Link Here
99
            %getransf = (
99
            %getransf = (
100
                %getransf,
100
                %getransf,
101
                title          => $biblio->title,
101
                title          => $biblio->title,
102
                subtitle       => C4::Biblio::SplitSubtitle($biblio->{'subtitle'}),
103
                medium         => $biblio->medium,
104
                part_number    => $biblio->part_number,
105
                part_name      => $biblio->part_name,
102
                author         => $biblio->author,
106
                author         => $biblio->author,
103
                biblionumber   => $biblio->biblionumber,
107
                biblionumber   => $biblio->biblionumber,
104
                itemnumber     => $item->itemnumber,
108
                itemnumber     => $item->itemnumber,
Lines 108-116 while ( my $library = $libraries->next ) { Link Here
108
                itemcallnumber => $item->itemcallnumber,
112
                itemcallnumber => $item->itemcallnumber,
109
            );
113
            );
110
114
111
            my $record = GetMarcBiblio({ biblionumber => $biblio->biblionumber });
112
            $getransf{'subtitle'} = GetRecordValue('subtitle', $record, $biblio->frameworkcode);
113
114
            # we check if we have a reserv for this transfer
115
            # we check if we have a reserv for this transfer
115
            my $holds = $item->current_holds;
116
            my $holds = $item->current_holds;
116
            if ( my $first_hold = $holds->next ) {
117
            if ( my $first_hold = $holds->next ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/waiting_holds.inc (-1 / +1 lines)
Lines 22-28 Link Here
22
                <td><span title="[% reserveloo.waitingdate | html %]">[% reserveloo.waitingdate | $KohaDates %]</span></td>
22
                <td><span title="[% reserveloo.waitingdate | html %]">[% reserveloo.waitingdate | $KohaDates %]</span></td>
23
                <td><span title="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %]</span></td>
23
                <td><span title="[% reserveloo.reservedate | html %]">[% reserveloo.reservedate | $KohaDates %]</span></td>
24
                <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
24
                <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
25
                    [% reserveloo.biblio.title | html %] [% FOREACH subtitl IN reserveloo.biblio.subtitles %] [% subtitl.subfield | html %][% END %]
25
                    [% reserveloo.biblio.title | html %] [% FOREACH subtitl IN reserveloo.biblio.subtitles %] [% subtitl | html %] [% reserveloo.biblio.part_number | html %] [% reserveloo.biblio.part_name | html %][% END %]
26
                    </a>
26
                    </a>
27
                        [% UNLESS ( item_level_itypes ) %]
27
                        [% UNLESS ( item_level_itypes ) %]
28
                            [% IF ( ItemTypes.GetDescription(reserveloo.item.effective_itemtype) ) %]&nbsp; (<b>[% ItemTypes.GetDescription(reserveloo.item.effective_itemtype) | html %]</b>)
28
                            [% IF ( ItemTypes.GetDescription(reserveloo.item.effective_itemtype) ) %]&nbsp; (<b>[% ItemTypes.GetDescription(reserveloo.item.effective_itemtype) | html %]</b>)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt (-1 / +1 lines)
Lines 77-83 Link Here
77
            <td>
77
            <td>
78
            <p>
78
            <p>
79
                [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
79
                [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %]
80
                [% reserveloo.title | html %] [% FOREACH s IN reserveloo.subtitle %] [% s | html %][% END %]</a></p>
80
                [% reserveloo.title | html %] [% FOREACH s IN reserveloo.subtitle %] [% s | html %][% END %] [% reserveloo.part_number | html %] [% reserveloo.part_name | html %]</a></p>
81
                [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author | html %]</p>[% END %]
81
                [% IF ( reserveloo.author ) %]<p> by [% reserveloo.author | html %]</p>[% END %]
82
            </td>
82
            </td>
83
        [% ELSE %]
83
        [% ELSE %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt (-1 / +5 lines)
Lines 123-129 Link Here
123
     <tbody>[% FOREACH itemsloo IN itemsloop %]
123
     <tbody>[% FOREACH itemsloo IN itemsloop %]
124
        <tr>
124
        <tr>
125
            <td class="hq-title">
125
            <td class="hq-title">
126
                <p><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemsloo.biblionumber | uri %]"><strong>[% itemsloo.title | html %]</strong> [% FOREACH s IN itemsloo.subtitle %] [% s | html %][% END %]</a></p>
126
                <p>
127
                    <a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% itemsloo.biblionumber | uri %]">
128
                        <strong>[% itemsloo.title | html %]</strong> [% FOREACH s IN itemsloo.subtitle %] [% s | html %][% END %] [% itemsloo.part_number | html %] [% itemsloo.part_name | html %]
129
                    </a>
130
                </p>
127
                <p>
131
                <p>
128
                    <div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
132
                    <div class="hq-biblionumber content_hidden">[% itemsloo.biblionumber | html %]</div>
129
                    <div class="hq-author">[% itemsloo.author | html %]</div>
133
                    <div class="hq-author">[% itemsloo.author | html %]</div>
(-)a/opac/opac-basket.pl (-1 / +1 lines)
Lines 105-111 foreach my $biblionumber ( @bibs ) { Link Here
105
        }
105
        }
106
    }
106
    }
107
107
108
    my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
108
    my $subtitle         = GetRecordValue('subtitle', $record);
109
109
110
    my $hasauthors = 0;
110
    my $hasauthors = 0;
111
    if($dat->{'author'} || @$marcauthorsarray) {
111
    if($dat->{'author'} || @$marcauthorsarray) {
(-)a/opac/opac-detail.pl (-1 / +1 lines)
Lines 768-774 if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) { Link Here
768
}
768
}
769
769
770
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
770
my $marcnotesarray   = GetMarcNotes   ($record,$marcflavour);
771
my $subtitle         = GetRecordValue('subtitle', $record, GetFrameworkCode($biblionumber));
771
my $subtitle         = GetRecordValue('subtitle', $record);
772
772
773
if( C4::Context->preference('ArticleRequests') ) {
773
if( C4::Context->preference('ArticleRequests') ) {
774
    my $patron = $borrowernumber ? Koha::Patrons->find($borrowernumber) : undef;
774
    my $patron = $borrowernumber ? Koha::Patrons->find($borrowernumber) : undef;
(-)a/opac/opac-readingrecord.pl (-2 / +1 lines)
Lines 98-105 foreach my $issue ( @{$issues} ) { Link Here
98
        my $marc_rec =
98
        my $marc_rec =
99
          MARC::Record::new_from_xml( $marcxml, 'utf8',
99
          MARC::Record::new_from_xml( $marcxml, 'utf8',
100
            C4::Context->preference('marcflavour') );
100
            C4::Context->preference('marcflavour') );
101
        $issue->{subtitle} =
101
        $issue->{subtitle} = GetRecordValue( 'subtitle', $marc_rec );
102
          GetRecordValue( 'subtitle', $marc_rec, $issue->{frameworkcode} );
103
        $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
102
        $issue->{normalized_upc} = GetNormalizedUPC( $marc_rec, C4::Context->preference('marcflavour') );
104
    }
103
    }
105
    # My Summary HTML
104
    # My Summary HTML
(-)a/opac/opac-reserve.pl (-2 / +4 lines)
Lines 405-411 $template->param('item_level_itypes' => $itemLevelTypes); Link Here
405
405
406
foreach my $biblioNum (@biblionumbers) {
406
foreach my $biblioNum (@biblionumbers) {
407
407
408
    my $record = GetMarcBiblio({ biblionumber => $biblioNum });
409
    # Init the bib item with the choices for branch pickup
408
    # Init the bib item with the choices for branch pickup
410
    my %biblioLoopIter;
409
    my %biblioLoopIter;
411
410
Lines 425-431 foreach my $biblioNum (@biblionumbers) { Link Here
425
    my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
424
    my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
426
    $biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
425
    $biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
427
    $biblioLoopIter{title} = $biblioData->{title};
426
    $biblioLoopIter{title} = $biblioData->{title};
428
    $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode);
427
    $biblioLoopIter{subtitle} = C4::Biblio::SplitSubtitle($biblioData->{'subtitle'});
428
    $biblioLoopIter{medium} = $biblioData->{medium};
429
    $biblioLoopIter{part_number} = $biblioData->{part_number};
430
    $biblioLoopIter{part_name} = $biblioData->{part_name};
429
    $biblioLoopIter{author} = $biblioData->{author};
431
    $biblioLoopIter{author} = $biblioData->{author};
430
    $biblioLoopIter{rank} = $biblioData->{rank};
432
    $biblioLoopIter{rank} = $biblioData->{rank};
431
    $biblioLoopIter{reservecount} = $biblioData->{reservecount};
433
    $biblioLoopIter{reservecount} = $biblioData->{reservecount};
(-)a/opac/opac-sendshelf.pl (-1 / +1 lines)
Lines 101-107 if ( $email ) { Link Here
101
101
102
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
102
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
103
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
103
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
104
        my $subtitle         = GetRecordValue('subtitle', $record, $fw);
104
        my $subtitle         = GetRecordValue('subtitle', $record);
105
105
106
        my @items = GetItemsInfo( $biblionumber );
106
        my @items = GetItemsInfo( $biblionumber );
107
107
(-)a/opac/opac-shelves.pl (-1 / +1 lines)
Lines 295-301 if ( $op eq 'view' ) { Link Here
295
                    $this_item->{notforloan}        = $itemtype->notforloan;
295
                    $this_item->{notforloan}        = $itemtype->notforloan;
296
                }
296
                }
297
                $this_item->{'coins'}           = GetCOinSBiblio($record);
297
                $this_item->{'coins'}           = GetCOinSBiblio($record);
298
                $this_item->{'subtitle'}        = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $biblionumber ) );
298
                $this_item->{'subtitle'}        = GetRecordValue( 'subtitle', $record ),
299
                $this_item->{'normalized_upc'}  = GetNormalizedUPC( $record, $marcflavour );
299
                $this_item->{'normalized_upc'}  = GetNormalizedUPC( $record, $marcflavour );
300
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
300
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
301
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
301
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
(-)a/opac/opac-showreviews.pl (-2 / +4 lines)
Lines 91-103 for my $result (@$reviews){ Link Here
91
    my $biblio = Koha::Biblios->find( $biblionumber );
91
    my $biblio = Koha::Biblios->find( $biblionumber );
92
    my $biblioitem = $biblio->biblioitem;
92
    my $biblioitem = $biblio->biblioitem;
93
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
93
    my $record = GetMarcBiblio({ biblionumber => $biblionumber });
94
    my $frameworkcode = GetFrameworkCode($biblionumber);
95
	$result->{normalized_upc} = GetNormalizedUPC($record,$marcflavour);
94
	$result->{normalized_upc} = GetNormalizedUPC($record,$marcflavour);
96
	$result->{normalized_ean} = GetNormalizedEAN($record,$marcflavour);
95
	$result->{normalized_ean} = GetNormalizedEAN($record,$marcflavour);
97
	$result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour);
96
	$result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour);
98
	$result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour);
97
	$result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour);
99
    $result->{title} = $biblio->title;
98
    $result->{title} = $biblio->title;
100
	$result->{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode);
99
    $result->{subtitle} = GetRecordValue('subtitle', $record );
100
    $result->{medium} = $biblio->medium;
101
    $result->{part_number} = $biblio->part_number;
102
    $result->{part_name} = $biblio->part_name;
101
    $result->{author} = $biblio->author;
103
    $result->{author} = $biblio->author;
102
    $result->{place} = $biblioitem->place;
104
    $result->{place} = $biblioitem->place;
103
    $result->{publishercode} = $biblioitem->publishercode;
105
    $result->{publishercode} = $biblioitem->publishercode;
(-)a/opac/opac-tags.pl (-1 / +4 lines)
Lines 256-263 if ($loggedinuser) { Link Here
256
            $hidden_items = \@hidden_itemnumbers;
256
            $hidden_items = \@hidden_itemnumbers;
257
        }
257
        }
258
        next if ( $should_hide && scalar @all_items == scalar @hidden_itemnumbers );
258
        next if ( $should_hide && scalar @all_items == scalar @hidden_itemnumbers );
259
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
260
        $tag->{title} = $biblio->title;
259
        $tag->{title} = $biblio->title;
260
        $tag->{subtitle} = C4::Biblio::SplitSubtitle($biblio->subtitle);
261
        $tag->{medium} = $biblio->medium;
262
        $tag->{part_number} = $biblio->part_number;
263
        $tag->{part_name} = $biblio->part_name;
261
        $tag->{author} = $biblio->author;
264
        $tag->{author} = $biblio->author;
262
265
263
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
266
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
(-)a/opac/opac-user.pl (-6 / +7 lines)
Lines 201-212 if ( $pending_checkouts->count ) { # Useless test Link Here
201
        );
201
        );
202
        $issue->{rentalfines} = $rental_fines->total_outstanding;
202
        $issue->{rentalfines} = $rental_fines->total_outstanding;
203
203
204
        my $marcrecord = GetMarcBiblio({
204
        $issue->{'subtitle'} = C4::Biblio::SplitSubtitle($issue->{'subtitle'});
205
            biblionumber => $issue->{'biblionumber'},
205
206
            embed_items  => 1,
207
            opac         => 1,
208
            borcat       => $borcat });
209
        $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'}));
210
        # check if item is renewable
206
        # check if item is renewable
211
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
207
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
212
        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
208
        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
Lines 258-263 if ( $pending_checkouts->count ) { # Useless test Link Here
258
254
259
        my $isbn = GetNormalizedISBN($issue->{'isbn'});
255
        my $isbn = GetNormalizedISBN($issue->{'isbn'});
260
        $issue->{normalized_isbn} = $isbn;
256
        $issue->{normalized_isbn} = $isbn;
257
        my $marcrecord = GetMarcBiblio({
258
            biblionumber => $issue->{'biblionumber'},
259
            embed_items  => 1,
260
            opac         => 1,
261
            borcat       => $borcat });
261
        $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') );
262
        $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') );
262
263
263
                # My Summary HTML
264
                # My Summary HTML
(-)a/svc/checkouts (-5 / +9 lines)
Lines 23-29 use CGI; Link Here
23
use JSON qw(to_json);
23
use JSON qw(to_json);
24
24
25
use C4::Auth qw(check_cookie_auth haspermission get_session);
25
use C4::Auth qw(check_cookie_auth haspermission get_session);
26
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue );
26
use C4::Biblio qw(SplitSubtitle);
27
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate);
27
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate);
28
use C4::Overdues qw(GetFine);
28
use C4::Overdues qw(GetFine);
29
use C4::Context;
29
use C4::Context;
Lines 74-79 my $sql = ' Link Here
74
74
75
        biblionumber,
75
        biblionumber,
76
        biblio.title,
76
        biblio.title,
77
        biblio.subtitle,
78
        biblio.medium,
79
        biblio.part_number,
80
        biblio.part_name,
77
        author,
81
        author,
78
82
79
        itemnumber,
83
        itemnumber,
Lines 174-179 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
174
    my $checkout = {
178
    my $checkout = {
175
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
179
        DT_RowId             => $c->{itemnumber} . '-' . $c->{borrowernumber},
176
        title                => $c->{title},
180
        title                => $c->{title},
181
        subtitle             => C4::Biblio::SplitSubtitle($c->{'subtitle'}),
182
        medium               => $c->{medium} // '',
183
        part_number          => $c->{part_number} // '',
184
        part_name            => $c->{part_name} // '',
177
        author               => $c->{author},
185
        author               => $c->{author},
178
        barcode              => $c->{barcode},
186
        barcode              => $c->{barcode},
179
        itemtype             => $item_level_itypes ? $c->{itype} : $c->{itemtype},
187
        itemtype             => $item_level_itypes ? $c->{itype} : $c->{itemtype},
Lines 216-225 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
216
                as_due_date => 1
224
                as_due_date => 1
217
            }
225
            }
218
        ),
226
        ),
219
        subtitle => GetRecordValue(
220
            'subtitle',
221
            GetMarcBiblio({ biblionumber => $c->{biblionumber} }),
222
            GetFrameworkCode( $c->{biblionumber} ) ),
223
        lost    => $lost,
227
        lost    => $lost,
224
        damaged => $damaged,
228
        damaged => $damaged,
225
        borrower => {
229
        borrower => {
(-)a/svc/holds (-8 / +9 lines)
Lines 23-29 use CGI; Link Here
23
use JSON qw(to_json);
23
use JSON qw(to_json);
24
24
25
use C4::Auth qw(check_cookie_auth);
25
use C4::Auth qw(check_cookie_auth);
26
use C4::Biblio qw(GetMarcBiblio GetFrameworkCode GetRecordValue );
26
use C4::Biblio qw(SplitSubtitle);
27
use C4::Charset;
27
use C4::Charset;
28
use C4::Circulation qw(GetTransfers);
28
use C4::Circulation qw(GetTransfers);
29
use C4::Context;
29
use C4::Context;
Lines 84-94 while ( my $h = $holds_rs->next() ) { Link Here
84
    for my $library ( @$libraries ) {
84
    for my $library ( @$libraries ) {
85
        $library->{selected} = 1 if $library->{branchcode} eq $h->branchcode();
85
        $library->{selected} = 1 if $library->{branchcode} eq $h->branchcode();
86
    }
86
    }
87
88
    my $biblio = $h->biblio();
87
    my $hold = {
89
    my $hold = {
88
        DT_RowId       => $h->reserve_id(),
90
        DT_RowId       => $h->reserve_id(),
89
        biblionumber   => $biblionumber,
91
        biblionumber   => $biblionumber,
90
        title          => $h->biblio()->title(),
92
        title          => $biblio->title(),
91
        author         => $h->biblio()->author(),
93
        subtitle       => $biblio->subtitle() // '',
94
        medium         => $biblio->medium() // '',
95
        part_number    => $biblio->part_number() // '',
96
        part_name      => $biblio->part_name() // '',
97
        author         => $biblio->author(),
92
        reserve_id     => $h->reserve_id(),
98
        reserve_id     => $h->reserve_id(),
93
        branchcode     => $h->branch()->branchname(),
99
        branchcode     => $h->branch()->branchname(),
94
        branches       => $libraries,
100
        branches       => $libraries,
Lines 102-112 while ( my $h = $holds_rs->next() ) { Link Here
102
        waiting_here   => $h->branch()->branchcode() eq $branch,
108
        waiting_here   => $h->branch()->branchcode() eq $branch,
103
        priority       => $h->priority(),
109
        priority       => $h->priority(),
104
        itemtype_limit => $itemtype_limit,
110
        itemtype_limit => $itemtype_limit,
105
        subtitle       => GetRecordValue(
106
            'subtitle',
107
            GetMarcBiblio({ biblionumber => $biblionumber }),
108
            GetFrameworkCode($biblionumber)
109
        ),
110
        reservedate_formatted => $h->reservedate() ? output_pref(
111
        reservedate_formatted => $h->reservedate() ? output_pref(
111
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
112
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
112
          )
113
          )
(-)a/t/Biblio.t (-1 / +1 lines)
Lines 51-57 warning_is { $ret = BiblioAutoLink(undef, q{}) } Link Here
51
51
52
is( $ret, 0, 'BiblioAutoLink returns zero if not passed rec');
52
is( $ret, 0, 'BiblioAutoLink returns zero if not passed rec');
53
53
54
warning_is { $ret = GetRecordValue('100', undef, q{}) }
54
warning_is { $ret = GetRecordValue('100', undef) }
55
           { carped => 'GetRecordValue called with undefined record'},
55
           { carped => 'GetRecordValue called with undefined record'},
56
           "GetRecordValue returns carped warning on undef record";
56
           "GetRecordValue returns carped warning on undef record";
57
57
(-)a/t/Biblio2.t (+16 lines)
Lines 52-55 sub _koha_marc_update_bib_ids_control { Link Here
52
    is($r->field('004')->data(), 20, 'Biblioitemnumber to control field');
52
    is($r->field('004')->data(), 20, 'Biblioitemnumber to control field');
53
}
53
}
54
54
55
subtest 'SplitSubtitle' => sub {
56
    plan tests => 4;
57
58
    my $res = C4::Biblio::SplitSubtitle(undef);
59
    is_deeply($res, [], 'undef returned as an array');
60
61
    $res = C4::Biblio::SplitSubtitle('');
62
    is_deeply($res, [], 'Empty string returned as an array');
63
64
    $res = C4::Biblio::SplitSubtitle('Single');
65
    is_deeply($res, [{'subfield' => 'Single'}], 'Single subtitle returns an array');
66
67
    $res = C4::Biblio::SplitSubtitle('First | Second');
68
    is_deeply($res, [{'subfield' => 'First'}, {'subfield' => 'Second'}], 'Two subtitles returns an array');
69
};
70
55
done_testing();
71
done_testing();
(-)a/tags/list.pl (-4 / +1 lines)
Lines 61-70 else { Link Here
61
        my $taglist = get_tag_rows( { term => $tag } );
61
        my $taglist = get_tag_rows( { term => $tag } );
62
        for ( @{$taglist} ) {
62
        for ( @{$taglist} ) {
63
            my $dat    = &GetBiblioData( $_->{biblionumber} );
63
            my $dat    = &GetBiblioData( $_->{biblionumber} );
64
            my $record = &GetMarcBiblio({ biblionumber => $_->{biblionumber} });
64
            $dat->{'subtitle'} = C4::Biblio::SplitSubtitles($dat->{'subtitle'}),
65
            $dat->{'subtitle'} =
66
              GetRecordValue( 'subtitle', $record,
67
                GetFrameworkCode( $_->{biblionumber} ) );
68
            my @items = GetItemsInfo( $_->{biblionumber} );
65
            my @items = GetItemsInfo( $_->{biblionumber} );
69
            $dat->{biblionumber} = $_->{biblionumber};
66
            $dat->{biblionumber} = $_->{biblionumber};
70
            $dat->{tag_id}       = $_->{tag_id};
67
            $dat->{tag_id}       = $_->{tag_id};
(-)a/tools/batch_delete_records.pl (-1 / +1 lines)
Lines 94-100 if ( $op eq 'form' ) { Link Here
94
            my $holds_count = $biblio->holds->count;
94
            my $holds_count = $biblio->holds->count;
95
            $biblio = $biblio->unblessed;
95
            $biblio = $biblio->unblessed;
96
            my $record = &GetMarcBiblio({ biblionumber => $record_id });
96
            my $record = &GetMarcBiblio({ biblionumber => $record_id });
97
            $biblio->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $record_id ) );
97
            $biblio->{subtitle} = C4::Biblio::SplitSubtitle( $biblio->{subtitle} );
98
            $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')];
98
            $biblio->{itemnumbers} = [Koha::Items->search({ biblionumber => $record_id })->get_column('itemnumber')];
99
            $biblio->{holds_count} = $holds_count;
99
            $biblio->{holds_count} = $holds_count;
100
            $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id );
100
            $biblio->{issues_count} = C4::Biblio::CountItemsIssued( $record_id );
(-)a/virtualshelves/sendshelf.pl (-2 / +1 lines)
Lines 77-90 if ($email) { Link Here
77
77
78
    while ( my $content = $contents->next ) {
78
    while ( my $content = $contents->next ) {
79
        my $biblionumber     = $content->biblionumber;
79
        my $biblionumber     = $content->biblionumber;
80
        my $fw               = GetFrameworkCode($biblionumber);
81
        my $dat              = GetBiblioData($biblionumber);
80
        my $dat              = GetBiblioData($biblionumber);
82
        my $record           = GetMarcBiblio({
81
        my $record           = GetMarcBiblio({
83
            biblionumber => $biblionumber,
82
            biblionumber => $biblionumber,
84
            embed_items  => 1 });
83
            embed_items  => 1 });
85
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
84
        my $marcauthorsarray = GetMarcAuthors( $record, $marcflavour );
86
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
85
        my $marcsubjctsarray = GetMarcSubjects( $record, $marcflavour );
87
        my $subtitle         = GetRecordValue( 'subtitle', $record, $fw );
86
        my $subtitle         = GetRecordValue( 'subtitle', $record );
88
87
89
        my @items = GetItemsInfo($biblionumber);
88
        my @items = GetItemsInfo($biblionumber);
90
89
(-)a/virtualshelves/shelves.pl (-2 / +1 lines)
Lines 280-286 if ( $op eq 'view' ) { Link Here
280
                $this_item->{description}       = $itemtype ? $itemtype->description : q{}; #FIXME Should this be translated_description ?
280
                $this_item->{description}       = $itemtype ? $itemtype->description : q{}; #FIXME Should this be translated_description ?
281
                $this_item->{notforloan}        = $itemtype->notforloan if $itemtype;
281
                $this_item->{notforloan}        = $itemtype->notforloan if $itemtype;
282
                $this_item->{'coins'}           = GetCOinSBiblio($record);
282
                $this_item->{'coins'}           = GetCOinSBiblio($record);
283
                $this_item->{'subtitle'}        = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $biblionumber ) );
283
                $this_item->{'subtitle'}        = GetRecordValue( 'subtitle', $record );
284
                $this_item->{'normalized_upc'}  = GetNormalizedUPC( $record, $marcflavour );
284
                $this_item->{'normalized_upc'}  = GetNormalizedUPC( $record, $marcflavour );
285
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
285
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
286
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
286
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
287
- 

Return to bug 11529