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

(-)a/Koha/Holding.pm (-2 / +19 lines)
Lines 22-30 use Modern::Perl; Link Here
22
22
23
use Carp;
23
use Carp;
24
24
25
use C4::Charset; # SetUTF8Flag
25
use C4::Charset qw( SetUTF8Flag );
26
use C4::Log; # logaction
26
use C4::Log qw( logaction );
27
27
28
use Koha::Biblio;
28
use Koha::Database;
29
use Koha::Database;
29
use Koha::DateUtils qw(dt_from_string);
30
use Koha::DateUtils qw(dt_from_string);
30
use Koha::Holdings::Metadatas;
31
use Koha::Holdings::Metadatas;
Lines 42-47 Koha::Holding - Koha Holding Object class Link Here
42
43
43
=cut
44
=cut
44
45
46
=head3 biblio
47
48
  my $biblio = $holding->biblio();
49
50
Returns the holding biblio for this record.
51
52
=cut
53
54
sub biblio {
55
    my ($self) = @_;
56
57
    my $biblio = $self->_result->biblionumber();
58
    return unless $biblio;
59
    return Koha::Biblio->_new_from_dbic($biblio);
60
}
61
45
=head3 holding_branch
62
=head3 holding_branch
46
63
47
my $branch = $hold->holding_branch();
64
my $branch = $hold->holding_branch();
(-)a/Koha/Holdings.pm (-1 / +1 lines)
Lines 23-29 use Modern::Perl; Link Here
23
use Carp;
23
use Carp;
24
24
25
use C4::Biblio;
25
use C4::Biblio;
26
use C4::Charset; # For SetMarcUnicodeFlag
26
use C4::Charset qw( SetMarcUnicodeFlag );
27
use C4::Context;
27
use C4::Context;
28
28
29
use Koha::Holding;
29
use Koha::Holding;
(-)a/cataloguing/addholding.pl (-15 / +8 lines)
Lines 20-45 Link Here
20
# You should have received a copy of the GNU General Public License
20
# You should have received a copy of the GNU General Public License
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
21
# along with Koha; if not, see <http://www.gnu.org/licenses>.
22
22
23
# TODO: refactor to avoid duplication from addbiblio
23
use Modern::Perl;
24
24
25
use strict;
26
#use warnings; FIXME - Bug 2505
27
use CGI q(-utf8);
25
use CGI q(-utf8);
28
use C4::Output;
26
use C4::Output qw( output_html_with_http_headers );
29
use C4::Auth;
27
use C4::Auth qw( get_template_and_user haspermission );
30
use C4::Search;
28
use C4::Biblio
31
use C4::Biblio;
29
  qw( GetMarcFromKohaField GetMarcStructure GetUsedMarcStructure TransformHtmlToMarc );
32
use C4::Context;
30
use C4::Context;
33
use MARC::Record;
31
use MARC::Record;
34
use C4::Log;
32
use C4::ClassSource qw( GetClassSources );
35
use C4::Koha;
36
use C4::ClassSource;
37
use C4::ImportBatch;
38
use C4::Charset;
39
use Koha::Biblios;
33
use Koha::Biblios;
40
use Koha::BiblioFrameworks;
34
use Koha::BiblioFrameworks;
41
use Koha::DateUtils;
35
use Koha::DateUtils qw( dt_from_string );
42
use C4::Matcher;
43
36
44
use Koha::ItemTypes;
37
use Koha::ItemTypes;
45
use Koha::Libraries;
38
use Koha::Libraries;
Lines 47-53 use Koha::Libraries; Link Here
47
use Date::Calc qw(Today);
40
use Date::Calc qw(Today);
48
use MARC::File::USMARC;
41
use MARC::File::USMARC;
49
use MARC::File::XML;
42
use MARC::File::XML;
50
use URI::Escape;
43
use URI::Escape qw( uri_escape_utf8 );
51
44
52
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
45
if ( C4::Context->preference('marcflavour') eq 'UNIMARC' ) {
53
    MARC::File::XML->default_record_format('UNIMARC');
46
    MARC::File::XML->default_record_format('UNIMARC');
(-)a/cataloguing/value_builder/marc21_field_008_holdings.pl (-2 / +3 lines)
Lines 19-28 Link Here
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
# along with Koha; if not, see <http://www.gnu.org/licenses>.
20
20
21
use Modern::Perl;
21
use Modern::Perl;
22
use C4::Auth;
22
use C4::Auth qw( get_template_and_user );
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use C4::Context;
24
use C4::Context;
25
use C4::Output;
25
26
use C4::Output qw( output_html_with_http_headers );
26
27
27
use XML::LibXML;
28
use XML::LibXML;
28
use Koha::Util::FrameworkPlugin qw|date_entered|;
29
use Koha::Util::FrameworkPlugin qw|date_entered|;
(-)a/cataloguing/value_builder/marc21_leader_holdings.pl (-2 / +2 lines)
Lines 21-29 Link Here
21
use Modern::Perl;
21
use Modern::Perl;
22
use CGI qw ( -utf8 );
22
use CGI qw ( -utf8 );
23
23
24
use C4::Auth;
24
use C4::Auth qw( get_template_and_user );
25
use C4::Context;
25
use C4::Context;
26
use C4::Output;
26
use C4::Output qw( output_html_with_http_headers );
27
27
28
my $builder = sub {
28
my $builder = sub {
29
    my ( $params ) = @_;
29
    my ( $params ) = @_;
(-)a/t/db_dependent/Koha/Holding.t (-2 / +2 lines)
Lines 38-44 my $schema = Koha::Database->new->schema; Link Here
38
38
39
subtest 'Koha::Holding tests' => sub {
39
subtest 'Koha::Holding tests' => sub {
40
40
41
    plan tests => 19;
41
    plan tests => 20;
42
42
43
    $schema->storage->txn_begin;
43
    $schema->storage->txn_begin;
44
44
Lines 167-172 subtest 'Koha::Holding tests' => sub { Link Here
167
    is(ref $holding, 'Koha::Holding', 'Found a Koha::Holding object');
167
    is(ref $holding, 'Koha::Holding', 'Found a Koha::Holding object');
168
    is($holding->frameworkcode(), $frameworkcode, 'Framework code correct in Koha::Holding object');
168
    is($holding->frameworkcode(), $frameworkcode, 'Framework code correct in Koha::Holding object');
169
    is($holding->holdingbranch(), 'ABC', 'Location correct in Koha::Holding object');
169
    is($holding->holdingbranch(), 'ABC', 'Location correct in Koha::Holding object');
170
    is($holding->biblio()->biblionumber(), $biblionumber, 'Biblio correct in Koha::Holding object');
170
171
171
    my $branch = $holding->holding_branch();
172
    my $branch = $holding->holding_branch();
172
    is(ref $branch, 'Koha::Library', 'holding_branch() returns a Koha::Library object');
173
    is(ref $branch, 'Koha::Library', 'holding_branch() returns a Koha::Library object');
173
- 

Return to bug 20447