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

(-)a/C4/HoldsQueue.pm (-8 / +6 lines)
Lines 131-137 sub GetHoldsQueueItems { Link Here
131
    my $dbh   = C4::Context->dbh;
131
    my $dbh   = C4::Context->dbh;
132
132
133
    my @bind_params = ();
133
    my @bind_params = ();
134
    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
134
    my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.itype, biblioitems.itemtype, items.location, 
135
                         items.enumchron, items.cn_sort, biblioitems.publishercode,
136
                         biblio.copyrightdate, biblio.subtitle, biblio.part_number as numbers, 
137
                         biblio.part_name as parts,
138
                         biblioitems.publicationyear, biblioitems.pages, biblioitems.size, biblioitems.publicationyear, 
139
                         biblioitems.isbn, items.copynumber
135
                  FROM tmp_holdsqueue
140
                  FROM tmp_holdsqueue
136
                       JOIN biblio      USING (biblionumber)
141
                       JOIN biblio      USING (biblionumber)
137
                  LEFT JOIN biblioitems USING (biblionumber)
142
                  LEFT JOIN biblioitems USING (biblionumber)
Lines 146-158 sub GetHoldsQueueItems { Link Here
146
    $sth->execute(@bind_params);
151
    $sth->execute(@bind_params);
147
    my $items = [];
152
    my $items = [];
148
    while ( my $row = $sth->fetchrow_hashref ){
153
    while ( my $row = $sth->fetchrow_hashref ){
149
        my $record = GetMarcBiblio({ biblionumber => $row->{biblionumber} });
150
        if ($record){
151
            $row->{subtitle} = [ map { $_->{subfield} } @{ GetRecordValue( 'subtitle', $record, '' ) } ];
152
            $row->{parts} = GetRecordValue('parts',$record,'')->[0]->{subfield};
153
            $row->{numbers} = GetRecordValue('numbers',$record,'')->[0]->{subfield};
154
        }
155
156
        # return the bib-level or item-level itype per syspref
154
        # return the bib-level or item-level itype per syspref
157
        if (!C4::Context->preference('item-level_itypes')) {
155
        if (!C4::Context->preference('item-level_itypes')) {
158
            $row->{itype} = $row->{itemtype};
156
            $row->{itype} = $row->{itemtype};
(-)a/C4/Overdues.pm (+4 lines)
Lines 750-755 sub GetOverduesForBranch { Link Here
750
            borrowers.phone,
750
            borrowers.phone,
751
            borrowers.email,
751
            borrowers.email,
752
               biblio.title,
752
               biblio.title,
753
               biblio.subtitle,
754
               biblio.medium,
755
               biblio.part_number,
756
               biblio.part_name,
753
               biblio.author,
757
               biblio.author,
754
               biblio.biblionumber,
758
               biblio.biblionumber,
755
               issues.date_due,
759
               issues.date_due,
(-)a/C4/ShelfBrowser.pm (-1 / +5 lines)
Lines 222-234 sub GetShelfInfo { Link Here
222
    for my $item ( @items ) {
222
    for my $item ( @items ) {
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
        my @subtitles = split(/ \| /, $this_biblio->{'subtitle'});
225
        $item->{'title'} = $this_biblio->{'title'};
226
        $item->{'title'} = $this_biblio->{'title'};
227
        $item->{'subtitle'} = \@subtitles,
228
        $item->{'medium'} = $this_biblio->{'medium'};
229
        $item->{'part_number'} = $this_biblio->{'part_number'};
230
        $item->{'part_name'} = $this_biblio->{'part_name'};
226
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
231
        my $this_record = GetMarcBiblio({ biblionumber => $this_biblio->{'biblionumber'} });
227
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
232
        $item->{'browser_normalized_upc'} = GetNormalizedUPC($this_record,$marcflavour);
228
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
233
        $item->{'browser_normalized_oclc'} = GetNormalizedOCLCNumber($this_record,$marcflavour);
229
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
234
        $item->{'browser_normalized_isbn'} = GetNormalizedISBN(undef,$this_record,$marcflavour);
230
        $item->{'browser_normalized_ean'} = GetNormalizedEAN($this_record,$marcflavour);
235
        $item->{'browser_normalized_ean'} = GetNormalizedEAN($this_record,$marcflavour);
231
        $item->{'subtitle'} = GetRecordValue('subtitle', $this_record, GetFrameworkCode( $item->{biblionumber} ));
232
        push @valid_items, $item;
236
        push @valid_items, $item;
233
    }
237
    }
234
    return @valid_items;
238
    return @valid_items;
(-)a/Koha/Biblio.pm (-8 / +3 lines)
Lines 65-84 sub store { Link Here
65
65
66
my @subtitles = $biblio->subtitles();
66
my @subtitles = $biblio->subtitles();
67
67
68
Returns list of subtitles for a record.
68
Returns list of subtitles for a record according to the framework.
69
70
Keyword to MARC mapping for subtitle must be set for this method to return any possible values.
71
69
72
=cut
70
=cut
73
71
74
sub subtitles {
72
sub subtitles {
75
    my ( $self ) = @_;
73
    my ( $self ) = @_;
76
74
77
    return map { $_->{subfield} } @{
75
    my @subtitles = split(/ \| /, $self->subtitle);
78
        C4::Biblio::GetRecordValue(
76
    return \@subtitles;
79
            'subtitle',
80
            C4::Biblio::GetMarcBiblio({ biblionumber => $self->id }),
81
            $self->frameworkcode ) };
82
}
77
}
83
78
84
=head3 can_article_request
79
=head3 can_article_request
(-)a/Koha/Schema/Result/Holding.pm (+242 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::Holding;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::Holding
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holdings>
19
20
=cut
21
22
__PACKAGE__->table("holdings");
23
24
=head1 ACCESSORS
25
26
=head2 holding_id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 biblionumber
33
34
  data_type: 'integer'
35
  default_value: 0
36
  is_foreign_key: 1
37
  is_nullable: 0
38
39
=head2 biblioitemnumber
40
41
  data_type: 'integer'
42
  default_value: 0
43
  is_foreign_key: 1
44
  is_nullable: 0
45
46
=head2 frameworkcode
47
48
  data_type: 'varchar'
49
  default_value: (empty string)
50
  is_nullable: 0
51
  size: 4
52
53
=head2 holdingbranch
54
55
  data_type: 'varchar'
56
  is_foreign_key: 1
57
  is_nullable: 1
58
  size: 10
59
60
=head2 location
61
62
  data_type: 'varchar'
63
  is_nullable: 1
64
  size: 80
65
66
=head2 callnumber
67
68
  data_type: 'varchar'
69
  is_nullable: 1
70
  size: 255
71
72
=head2 suppress
73
74
  data_type: 'tinyint'
75
  is_nullable: 1
76
77
=head2 timestamp
78
79
  data_type: 'timestamp'
80
  datetime_undef_if_invalid: 1
81
  default_value: 'current_timestamp()'
82
  is_nullable: 0
83
84
=head2 datecreated
85
86
  data_type: 'date'
87
  datetime_undef_if_invalid: 1
88
  is_nullable: 0
89
90
=head2 deleted_on
91
92
  data_type: 'datetime'
93
  datetime_undef_if_invalid: 1
94
  is_nullable: 1
95
96
=cut
97
98
__PACKAGE__->add_columns(
99
  "holding_id",
100
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
101
  "biblionumber",
102
  {
103
    data_type      => "integer",
104
    default_value  => 0,
105
    is_foreign_key => 1,
106
    is_nullable    => 0,
107
  },
108
  "biblioitemnumber",
109
  {
110
    data_type      => "integer",
111
    default_value  => 0,
112
    is_foreign_key => 1,
113
    is_nullable    => 0,
114
  },
115
  "frameworkcode",
116
  { data_type => "varchar", default_value => "", is_nullable => 0, size => 4 },
117
  "holdingbranch",
118
  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
119
  "location",
120
  { data_type => "varchar", is_nullable => 1, size => 80 },
121
  "callnumber",
122
  { data_type => "varchar", is_nullable => 1, size => 255 },
123
  "suppress",
124
  { data_type => "tinyint", is_nullable => 1 },
125
  "timestamp",
126
  {
127
    data_type => "timestamp",
128
    datetime_undef_if_invalid => 1,
129
    default_value => "current_timestamp()",
130
    is_nullable => 0,
131
  },
132
  "datecreated",
133
  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 0 },
134
  "deleted_on",
135
  {
136
    data_type => "datetime",
137
    datetime_undef_if_invalid => 1,
138
    is_nullable => 1,
139
  },
140
);
141
142
=head1 PRIMARY KEY
143
144
=over 4
145
146
=item * L</holding_id>
147
148
=back
149
150
=cut
151
152
__PACKAGE__->set_primary_key("holding_id");
153
154
=head1 RELATIONS
155
156
=head2 biblioitemnumber
157
158
Type: belongs_to
159
160
Related object: L<Koha::Schema::Result::Biblioitem>
161
162
=cut
163
164
__PACKAGE__->belongs_to(
165
  "biblioitemnumber",
166
  "Koha::Schema::Result::Biblioitem",
167
  { biblioitemnumber => "biblioitemnumber" },
168
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
169
);
170
171
=head2 biblionumber
172
173
Type: belongs_to
174
175
Related object: L<Koha::Schema::Result::Biblio>
176
177
=cut
178
179
__PACKAGE__->belongs_to(
180
  "biblionumber",
181
  "Koha::Schema::Result::Biblio",
182
  { biblionumber => "biblionumber" },
183
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
184
);
185
186
=head2 holdingbranch
187
188
Type: belongs_to
189
190
Related object: L<Koha::Schema::Result::Branch>
191
192
=cut
193
194
__PACKAGE__->belongs_to(
195
  "holdingbranch",
196
  "Koha::Schema::Result::Branch",
197
  { branchcode => "holdingbranch" },
198
  {
199
    is_deferrable => 1,
200
    join_type     => "LEFT",
201
    on_delete     => "RESTRICT",
202
    on_update     => "CASCADE",
203
  },
204
);
205
206
=head2 holdings_metadatas
207
208
Type: has_many
209
210
Related object: L<Koha::Schema::Result::HoldingsMetadata>
211
212
=cut
213
214
__PACKAGE__->has_many(
215
  "holdings_metadatas",
216
  "Koha::Schema::Result::HoldingsMetadata",
217
  { "foreign.holding_id" => "self.holding_id" },
218
  { cascade_copy => 0, cascade_delete => 0 },
219
);
220
221
=head2 items
222
223
Type: has_many
224
225
Related object: L<Koha::Schema::Result::Item>
226
227
=cut
228
229
__PACKAGE__->has_many(
230
  "items",
231
  "Koha::Schema::Result::Item",
232
  { "foreign.holding_id" => "self.holding_id" },
233
  { cascade_copy => 0, cascade_delete => 0 },
234
);
235
236
237
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-10-26 12:34:01
238
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:iCl1nPLIbzMbSIHTDYHVcA
239
240
241
# You can replace this text with custom code or comments, and it will be preserved on regeneration
242
1;
(-)a/Koha/Schema/Result/HoldingsMetadata.pm (+138 lines)
Line 0 Link Here
1
use utf8;
2
package Koha::Schema::Result::HoldingsMetadata;
3
4
# Created by DBIx::Class::Schema::Loader
5
# DO NOT MODIFY THE FIRST PART OF THIS FILE
6
7
=head1 NAME
8
9
Koha::Schema::Result::HoldingsMetadata
10
11
=cut
12
13
use strict;
14
use warnings;
15
16
use base 'DBIx::Class::Core';
17
18
=head1 TABLE: C<holdings_metadata>
19
20
=cut
21
22
__PACKAGE__->table("holdings_metadata");
23
24
=head1 ACCESSORS
25
26
=head2 id
27
28
  data_type: 'integer'
29
  is_auto_increment: 1
30
  is_nullable: 0
31
32
=head2 holding_id
33
34
  data_type: 'integer'
35
  is_foreign_key: 1
36
  is_nullable: 0
37
38
=head2 format
39
40
  data_type: 'varchar'
41
  is_nullable: 0
42
  size: 16
43
44
=head2 marcflavour
45
46
  data_type: 'varchar'
47
  is_nullable: 0
48
  size: 16
49
50
=head2 metadata
51
52
  data_type: 'longtext'
53
  is_nullable: 0
54
55
=head2 deleted_on
56
57
  data_type: 'datetime'
58
  datetime_undef_if_invalid: 1
59
  is_nullable: 1
60
61
=cut
62
63
__PACKAGE__->add_columns(
64
  "id",
65
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
66
  "holding_id",
67
  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
68
  "format",
69
  { data_type => "varchar", is_nullable => 0, size => 16 },
70
  "marcflavour",
71
  { data_type => "varchar", is_nullable => 0, size => 16 },
72
  "metadata",
73
  { data_type => "longtext", is_nullable => 0 },
74
  "deleted_on",
75
  {
76
    data_type => "datetime",
77
    datetime_undef_if_invalid => 1,
78
    is_nullable => 1,
79
  },
80
);
81
82
=head1 PRIMARY KEY
83
84
=over 4
85
86
=item * L</id>
87
88
=back
89
90
=cut
91
92
__PACKAGE__->set_primary_key("id");
93
94
=head1 UNIQUE CONSTRAINTS
95
96
=head2 C<holdings_metadata_uniq_key>
97
98
=over 4
99
100
=item * L</holding_id>
101
102
=item * L</format>
103
104
=item * L</marcflavour>
105
106
=back
107
108
=cut
109
110
__PACKAGE__->add_unique_constraint(
111
  "holdings_metadata_uniq_key",
112
  ["holding_id", "format", "marcflavour"],
113
);
114
115
=head1 RELATIONS
116
117
=head2 holding
118
119
Type: belongs_to
120
121
Related object: L<Koha::Schema::Result::Holding>
122
123
=cut
124
125
__PACKAGE__->belongs_to(
126
  "holding",
127
  "Koha::Schema::Result::Holding",
128
  { holding_id => "holding_id" },
129
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
130
);
131
132
133
# Created by DBIx::Class::Schema::Loader v0.07048 @ 2018-10-26 12:34:01
134
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oUc/EZTrVGoRcM1885DOkw
135
136
137
# You can replace this text with custom code or comments, and it will be preserved on regeneration
138
1;
(-)a/circ/branchoverdues.pl (-4 / +4 lines)
Lines 74-86 if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { Link Here
74
# now display infos
74
# now display infos
75
foreach my $num (@getoverdues) {
75
foreach my $num (@getoverdues) {
76
    my %overdueforbranch;
76
    my %overdueforbranch;
77
    my $record = GetMarcBiblio({ biblionumber => $num->{biblionumber} });
78
    if ($record){
79
        $overdueforbranch{'subtitle'} = GetRecordValue('subtitle',$record,'')->[0]->{subfield};
80
    }
81
    my $dt = dt_from_string($num->{date_due}, 'sql');
77
    my $dt = dt_from_string($num->{date_due}, 'sql');
82
    $overdueforbranch{'date_due'}          = output_pref($dt);
78
    $overdueforbranch{'date_due'}          = output_pref($dt);
83
    $overdueforbranch{'title'}             = $num->{'title'};
79
    $overdueforbranch{'title'}             = $num->{'title'};
80
    $overdueforbranch{'subtitle'}          = $num->{'subtitle'};
81
    $overdueforbranch{'medium'}            = $num->{'medium'};
82
    $overdueforbranch{'part_number'}       = $num->{'part_number'};
83
    $overdueforbranch{'part_name'}         = $num->{'part_name'};
84
    $overdueforbranch{'description'}       = $num->{'description'};
84
    $overdueforbranch{'description'}       = $num->{'description'};
85
    $overdueforbranch{'barcode'}           = $num->{'barcode'};
85
    $overdueforbranch{'barcode'}           = $num->{'barcode'};
86
    $overdueforbranch{'biblionumber'}      = $num->{'biblionumber'};
86
    $overdueforbranch{'biblionumber'}      = $num->{'biblionumber'};
(-)a/circ/reserveratios.pl (-4 / +6 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} });
160
    my @subtitles = split(/ \| /, $data->{'subtitle'});
158
    $data->{subtitle} = GetRecordValue('subtitle', $record, GetFrameworkCode($data->{biblionumber}));
159
    push(
161
    push(
160
        @reservedata,
162
        @reservedata,
161
        {
163
        {
Lines 163-169 while ( my $data = $sth->fetchrow_hashref ) { Link Here
163
            priority           => $data->{priority},
165
            priority           => $data->{priority},
164
            name               => $data->{borrower},
166
            name               => $data->{borrower},
165
            title              => $data->{title},
167
            title              => $data->{title},
166
            subtitle           => $data->{subtitle},
168
            subtitle           => \@subtitles,
167
            author             => $data->{author},
169
            author             => $data->{author},
168
            itemnum            => $data->{itemnumber},
170
            itemnum            => $data->{itemnumber},
169
            biblionumber       => $data->{biblionumber},
171
            biblionumber       => $data->{biblionumber},
(-)a/circ/transferstoreceive.pl (-3 / +5 lines)
Lines 96-104 while ( my $library = $libraries->next ) { Link Here
96
96
97
            $getransf{'datetransfer'} = $num->{'datesent'};
97
            $getransf{'datetransfer'} = $num->{'datesent'};
98
            $getransf{'itemtype'} = $itemtype->description; # FIXME Should not it be translated_description?
98
            $getransf{'itemtype'} = $itemtype->description; # FIXME Should not it be translated_description?
99
            my @subtitles = split(/ \| /, $biblio->{'subtitle'});
99
            %getransf = (
100
            %getransf = (
100
                %getransf,
101
                %getransf,
101
                title          => $biblio->title,
102
                title          => $biblio->title,
103
                subtitle       => \@subtitles,
104
                medium         => $biblio->medium,
105
                part_number    => $biblio->part_number,
106
                part_name      => $biblio->part_name,
102
                author         => $biblio->author,
107
                author         => $biblio->author,
103
                biblionumber   => $biblio->biblionumber,
108
                biblionumber   => $biblio->biblionumber,
104
                itemnumber     => $item->itemnumber,
109
                itemnumber     => $item->itemnumber,
Lines 108-116 while ( my $library = $libraries->next ) { Link Here
108
                itemcallnumber => $item->itemcallnumber,
113
                itemcallnumber => $item->itemcallnumber,
109
            );
114
            );
110
115
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
116
            # we check if we have a reserv for this transfer
115
            my $holds = $item->current_holds;
117
            my $holds = $item->current_holds;
116
            if ( my $first_hold = $holds->next ) {
118
            if ( my $first_hold = $holds->next ) {
(-)a/circ/waitingreserves.pl (-4 / +4 lines)
Lines 101-106 while ( my $hold = $holds->next ) { Link Here
101
101
102
    my %getreserv = (
102
    my %getreserv = (
103
        title             => $biblio->title,
103
        title             => $biblio->title,
104
        subtitle          => $biblio->subtitles,
105
        medium            => $biblio->medium,
106
        part_number       => $biblio->part_number,
107
        part_name         => $biblio->part_name,
104
        itemnumber        => $item->itemnumber,
108
        itemnumber        => $item->itemnumber,
105
        waitingdate       => $hold->waitingdate,
109
        waitingdate       => $hold->waitingdate,
106
        reservedate       => $hold->reservedate,
110
        reservedate       => $hold->reservedate,
Lines 122-131 while ( my $hold = $holds->next ) { Link Here
122
    my $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day );
126
    my $calcDate = Date_to_Days( $expire_year, $expire_month, $expire_day );
123
127
124
    $getreserv{'itemtype'}       = $itemtype->description; # FIXME Should not it be translated_description?
128
    $getreserv{'itemtype'}       = $itemtype->description; # FIXME Should not it be translated_description?
125
    $getreserv{'subtitle'}       = GetRecordValue(
126
        'subtitle',
127
        GetMarcBiblio({ biblionumber => $biblio->biblionumber }),
128
        $biblio->frameworkcode);
129
    if ( $homebranch ne $holdingbranch ) {
129
    if ( $homebranch ne $holdingbranch ) {
130
        $getreserv{'dotransfer'} = 1;
130
        $getreserv{'dotransfer'} = 1;
131
    }
131
    }
(-)a/opac/opac-reserve.pl (-2 / +5 lines)
Lines 390-396 $template->param('item_level_itypes' => $itemLevelTypes); Link Here
390
foreach my $biblioNum (@biblionumbers) {
390
foreach my $biblioNum (@biblionumbers) {
391
391
392
    my @not_available_at = ();
392
    my @not_available_at = ();
393
    my $record = GetMarcBiblio({ biblionumber => $biblioNum });
394
    # Init the bib item with the choices for branch pickup
393
    # Init the bib item with the choices for branch pickup
395
    my %biblioLoopIter;
394
    my %biblioLoopIter;
396
395
Lines 402-410 foreach my $biblioNum (@biblionumbers) { Link Here
402
    }
401
    }
403
402
404
    my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
403
    my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} );
404
    my @subtitles = split(/ \| /, $biblioData->{'subtitle'});    
405
    $biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
405
    $biblioLoopIter{biblionumber} = $biblioData->{biblionumber};
406
    $biblioLoopIter{title} = $biblioData->{title};
406
    $biblioLoopIter{title} = $biblioData->{title};
407
    $biblioLoopIter{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode);
407
    $biblioLoopIter{subtitle} = \@subtitles;
408
    $biblioLoopIter{medium} = $biblioData->{medium};
409
    $biblioLoopIter{part_number} = $biblioData->{part_number};
410
    $biblioLoopIter{part_name} = $biblioData->{part_name};
408
    $biblioLoopIter{author} = $biblioData->{author};
411
    $biblioLoopIter{author} = $biblioData->{author};
409
    $biblioLoopIter{rank} = $biblioData->{rank};
412
    $biblioLoopIter{rank} = $biblioData->{rank};
410
    $biblioLoopIter{reservecount} = $biblioData->{reservecount};
413
    $biblioLoopIter{reservecount} = $biblioData->{reservecount};
(-)a/opac/opac-shelves.pl (-1 / +2 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
                my @subtitles = split(/ \| /, $this_item->{'subtitle'});
299
                $this_item->{'subtitle'}        = \@subtitles,
299
                $this_item->{'normalized_upc'}  = GetNormalizedUPC( $record, $marcflavour );
300
                $this_item->{'normalized_upc'}  = GetNormalizedUPC( $record, $marcflavour );
300
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
301
                $this_item->{'normalized_ean'}  = GetNormalizedEAN( $record, $marcflavour );
301
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
302
                $this_item->{'normalized_oclc'} = GetNormalizedOCLCNumber( $record, $marcflavour );
(-)a/opac/opac-showreviews.pl (-1 / +4 lines)
Lines 97-103 for my $result (@$reviews){ Link Here
97
	$result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour);
97
	$result->{normalized_oclc} = GetNormalizedOCLCNumber($record,$marcflavour);
98
	$result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour);
98
	$result->{normalized_isbn} = GetNormalizedISBN(undef,$record,$marcflavour);
99
    $result->{title} = $biblio->title;
99
    $result->{title} = $biblio->title;
100
	$result->{subtitle} = GetRecordValue('subtitle', $record, $frameworkcode);
100
	$result->{subtitle} = $biblio->subtitles;
101
	$result->{medium} = $biblio->medium;
102
	$result->{part_number} = $biblio->part_number;
103
	$result->{part_name} = $biblio->part_name;
101
    $result->{author} = $biblio->author;
104
    $result->{author} = $biblio->author;
102
    $result->{place} = $biblioitem->place;
105
    $result->{place} = $biblioitem->place;
103
    $result->{publishercode} = $biblioitem->publishercode;
106
    $result->{publishercode} = $biblioitem->publishercode;
(-)a/opac/opac-tags.pl (-1 / +4 lines)
Lines 233-240 if ($loggedinuser) { Link Here
233
    foreach my $tag (@$my_tags) {
233
    foreach my $tag (@$my_tags) {
234
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
234
        my $biblio = Koha::Biblios->find( $tag->{biblionumber} );
235
        my $record = &GetMarcBiblio({ biblionumber => $tag->{biblionumber} });
235
        my $record = &GetMarcBiblio({ biblionumber => $tag->{biblionumber} });
236
        $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) );
237
        $tag->{title} = $biblio->title;
236
        $tag->{title} = $biblio->title;
237
        $tag->{subtitle} = $biblio->subtitles;
238
        $tag->{medium} = $biblio->medium;
239
        $tag->{part_number} = $biblio->part_number;
240
        $tag->{part_name} = $biblio->part_name;
238
        $tag->{author} = $biblio->author;
241
        $tag->{author} = $biblio->author;
239
242
240
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
243
        my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay');
(-)a/opac/opac-user.pl (-2 / +4 lines)
Lines 215-222 if ( $pending_checkouts->count ) { # Useless test Link Here
215
        );
215
        );
216
        $issue->{rentalfines} = $rental_fines->count ? $rental_fines->next->get_column('rental_fines') : 0;
216
        $issue->{rentalfines} = $rental_fines->count ? $rental_fines->next->get_column('rental_fines') : 0;
217
217
218
        my $marcrecord = GetMarcBiblio({ biblionumber => $issue->{'biblionumber'} });
218
        my @subtitles = split(/ \| /, $issue->{'subtitle'});
219
        $issue->{'subtitle'} = GetRecordValue('subtitle', $marcrecord, GetFrameworkCode($issue->{'biblionumber'}));
219
        $issue->{'subtitle'} = \@subtitles<
220
        
220
        # check if item is renewable
221
        # check if item is renewable
221
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
222
        my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} );
222
        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
223
        ($issue->{'renewcount'},$issue->{'renewsallowed'},$issue->{'renewsleft'}) = GetRenewCount($borrowernumber, $issue->{'itemnumber'});
Lines 266-271 if ( $pending_checkouts->count ) { # Useless test Link Here
266
267
267
        my $isbn = GetNormalizedISBN($issue->{'isbn'});
268
        my $isbn = GetNormalizedISBN($issue->{'isbn'});
268
        $issue->{normalized_isbn} = $isbn;
269
        $issue->{normalized_isbn} = $isbn;
270
        my $marcrecord = GetMarcBiblio({ biblionumber => $issue->{'biblionumber'} });
269
        $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') );
271
        $issue->{normalized_upc} = GetNormalizedUPC( $marcrecord, C4::Context->preference('marcflavour') );
270
272
271
                # My Summary HTML
273
                # 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 );
27
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate);
26
use C4::Circulation qw(GetIssuingCharges CanBookBeRenewed GetRenewCount GetSoonestRenewDate);
28
use C4::Overdues qw(GetFine);
27
use C4::Overdues qw(GetFine);
29
use C4::Context;
28
use C4::Context;
Lines 74-79 my $sql = ' Link Here
74
73
75
        biblionumber,
74
        biblionumber,
76
        biblio.title,
75
        biblio.title,
76
        biblio.subtitle,
77
        biblio.medium,
78
        biblio.part_number,
79
        biblio.part_name,
77
        author,
80
        author,
78
81
79
        itemnumber,
82
        itemnumber,
Lines 171-179 while ( my $c = $sth->fetchrow_hashref() ) { Link Here
171
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
174
        my $av = Koha::AuthorisedValues->search({ category => 'DAMAGED', authorised_value => $c->{damaged} });
172
        $damaged = $av->count ? $av->next->lib : '';
175
        $damaged = $av->count ? $av->next->lib : '';
173
    }
176
    }
177
    my @subtitles = split(/ \| /, $c->{'subtitle'});
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             => \@subtitles,
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 / +8 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 );
27
use C4::Charset;
26
use C4::Charset;
28
use C4::Circulation qw(GetTransfers);
27
use C4::Circulation qw(GetTransfers);
29
use C4::Context;
28
use C4::Context;
Lines 84-94 while ( my $h = $holds_rs->next() ) { Link Here
84
    for my $library ( @$libraries ) {
83
    for my $library ( @$libraries ) {
85
        $library->{selected} = 1 if $library->{branchcode} eq $h->branchcode();
84
        $library->{selected} = 1 if $library->{branchcode} eq $h->branchcode();
86
    }
85
    }
86
87
    my $biblio = $h->biblio();
87
    my $hold = {
88
    my $hold = {
88
        DT_RowId       => $h->reserve_id(),
89
        DT_RowId       => $h->reserve_id(),
89
        biblionumber   => $biblionumber,
90
        biblionumber   => $biblionumber,
90
        title          => $h->biblio()->title(),
91
        title          => $biblio->title(),
91
        author         => $h->biblio()->author(),
92
        subtitle       => $biblio->subtitles(),
93
        medium         => $biblio->medium(),
94
        part_number    => $biblio->part_number(),
95
        part_name      => $biblio->part_name(),
96
        author         => $biblio->author(),
92
        reserve_id     => $h->reserve_id(),
97
        reserve_id     => $h->reserve_id(),
93
        branchcode     => $h->branch()->branchname(),
98
        branchcode     => $h->branch()->branchname(),
94
        branches       => $libraries,
99
        branches       => $libraries,
Lines 102-112 while ( my $h = $holds_rs->next() ) { Link Here
102
        waiting_here   => $h->branch()->branchcode() eq $branch,
107
        waiting_here   => $h->branch()->branchcode() eq $branch,
103
        priority       => $h->priority(),
108
        priority       => $h->priority(),
104
        itemtype_limit => $itemtype_limit,
109
        itemtype_limit => $itemtype_limit,
105
        subtitle       => GetRecordValue(
106
            'subtitle',
107
            GetMarcBiblio({ biblionumber => $biblionumber }),
108
            GetFrameworkCode($biblionumber)
109
        ),
110
        reservedate_formatted => $h->reservedate() ? output_pref(
110
        reservedate_formatted => $h->reservedate() ? output_pref(
111
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
111
            { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
112
          )
112
          )
(-)a/tags/list.pl (-5 / +2 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
            my @subtitles = split(/ \| /, $dat->{'subtitle'});
65
            $dat->{'subtitle'} =
65
            $dat->{'subtitle'} = \@subtitles,
66
              GetRecordValue( 'subtitle', $record,
67
                GetFrameworkCode( $_->{biblionumber} ) );
68
            my @items = GetItemsInfo( $_->{biblionumber} );
66
            my @items = GetItemsInfo( $_->{biblionumber} );
69
            $dat->{biblionumber} = $_->{biblionumber};
67
            $dat->{biblionumber} = $_->{biblionumber};
70
            $dat->{tag_id}       = $_->{tag_id};
68
            $dat->{tag_id}       = $_->{tag_id};
71
- 

Return to bug 11529