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

(-)a/C4/ItemCirculationAlertPreference.pm (-2 / +3 lines)
Lines 21-29 use strict; Link Here
21
use warnings;
21
use warnings;
22
use C4::Context;
22
use C4::Context;
23
use C4::Category;
23
use C4::Category;
24
use C4::ItemType;
25
use Carp qw(carp croak);
24
use Carp qw(carp croak);
26
25
26
use Koha::ItemTypes;
27
27
our $AUTOLOAD;
28
our $AUTOLOAD;
28
29
29
# helper function for validating \%opts
30
# helper function for validating \%opts
Lines 331-337 sub grid { Link Here
331
    my @branch_prefs = $class->find($where);
332
    my @branch_prefs = $class->find($where);
332
    my @default_prefs = $class->find({ branchcode => '*', notification => $where->{notification} });
333
    my @default_prefs = $class->find({ branchcode => '*', notification => $where->{notification} });
333
    my @cc = C4::Category->all;
334
    my @cc = C4::Category->all;
334
    my @it = C4::ItemType->all;
335
    my @it = Koha::ItemTypes->search;
335
    my $notification = $where->{notification};
336
    my $notification = $where->{notification};
336
    my %disabled = map {
337
    my %disabled = map {
337
        my $key = $_->categorycode . "-" . $_->item_type . "-" . $notification;
338
        my $key = $_->categorycode . "-" . $_->item_type . "-" . $notification;
(-)a/acqui/neworderempty.pl (-1 / +2 lines)
Lines 89-94 use C4::Search qw/FindDuplicate/; Link Here
89
use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus/;
89
use C4::ImportBatch qw/GetImportRecordMarc SetImportRecordStatus/;
90
90
91
use Koha::Acquisition::Bookseller;
91
use Koha::Acquisition::Bookseller;
92
use Koha::ItemTypes;
92
93
93
our $input           = new CGI;
94
our $input           = new CGI;
94
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
95
my $booksellerid    = $input->param('booksellerid');	# FIXME: else ERROR!
Lines 303-309 if (C4::Context->preference('AcqCreateItem') eq 'ordering' && !$ordernumber) { Link Here
303
}
304
}
304
# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
305
# Get the item types list, but only if item_level_itype is YES. Otherwise, it will be in the item, no need to display it in the biblio
305
my @itemtypes;
306
my @itemtypes;
306
@itemtypes = C4::ItemType->all unless C4::Context->preference('item-level_itypes');
307
@itemtypes = Koha::ItemTypes->search unless C4::Context->preference('item-level_itypes');
307
308
308
if ( defined $subscriptionid ) {
309
if ( defined $subscriptionid ) {
309
    my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
310
    my $lastOrderReceived = GetLastOrderReceivedFromSubscriptionid $subscriptionid;
(-)a/admin/item_circulation_alerts.pl (-15 / +3 lines)
Lines 28-51 use C4::Auth; Link Here
28
use C4::Context;
28
use C4::Context;
29
use C4::Branch;
29
use C4::Branch;
30
use C4::Category;
30
use C4::Category;
31
use C4::ItemType;
32
use C4::ItemCirculationAlertPreference;
31
use C4::ItemCirculationAlertPreference;
33
use C4::Output;
32
use C4::Output;
34
33
34
use Koha::ItemTypes;
35
35
# shortcut for long package name
36
# shortcut for long package name
36
our $preferences = 'C4::ItemCirculationAlertPreference';
37
our $preferences = 'C4::ItemCirculationAlertPreference';
37
38
38
# prepend "br_" to column name and replace spaces with "<br/>"
39
sub br {
40
    my ($data, @keys) = @_;
41
    for (@keys) {
42
        my $br = $data->{$_};
43
        $br =~ s{\s+}{<br/>}g;
44
        $data->{'br_'.$_} = $br;
45
    }
46
    $data;
47
}
48
49
# display item circulation alerts
39
# display item circulation alerts
50
sub show {
40
sub show {
51
    my ($input) = @_;
41
    my ($input) = @_;
Lines 78-86 sub show { Link Here
78
    my @categories = (
68
    my @categories = (
79
        C4::Category->all
69
        C4::Category->all
80
    );
70
    );
81
    my @item_types = map { br($_, 'description') }  (
71
    my @item_types = Koha::ItemTypes->search;
82
        C4::ItemType->all
83
    );
84
    my $grid_checkout = $preferences->grid({ branchcode => $branch, notification => 'CHECKOUT' });
72
    my $grid_checkout = $preferences->grid({ branchcode => $branch, notification => 'CHECKOUT' });
85
    my $grid_checkin  = $preferences->grid({ branchcode => $branch, notification => 'CHECKIN' });
73
    my $grid_checkin  = $preferences->grid({ branchcode => $branch, notification => 'CHECKIN' });
86
74
(-)a/catalogue/itemsearch.pl (-5 / +7 lines)
Lines 27-35 use C4::Items; Link Here
27
use C4::Biblio;
27
use C4::Biblio;
28
use C4::Branch;
28
use C4::Branch;
29
use C4::Koha;
29
use C4::Koha;
30
use C4::ItemType;
31
30
32
use Koha::Item::Search::Field qw(GetItemSearchFields);
31
use Koha::Item::Search::Field qw(GetItemSearchFields);
32
use Koha::ItemTypes;
33
33
34
my $cgi = new CGI;
34
my $cgi = new CGI;
35
my %params = $cgi->Vars;
35
my %params = $cgi->Vars;
Lines 262-271 if ($format eq 'html') { Link Here
262
            label => $location->{lib} // $location->{authorised_value},
262
            label => $location->{lib} // $location->{authorised_value},
263
        };
263
        };
264
    }
264
    }
265
    my @itemtypes = C4::ItemType->all();
265
    my @itemtypes;
266
    foreach my $itemtype (@itemtypes) {
266
    foreach my $itemtype ( Koha::ItemTypes->search ) {
267
        $itemtype->{value} = $itemtype->{itemtype};
267
        push @itemtypes, {
268
        $itemtype->{label} = $itemtype->{translated_description};
268
            value => $itemtype->itemtype,
269
            label => $itemtype->translated_description,
270
        };
269
    }
271
    }
270
    my $ccode_avcode = GetAuthValCode('items.ccode') || 'CCODE';
272
    my $ccode_avcode = GetAuthValCode('items.ccode') || 'CCODE';
271
    my $ccodes = GetAuthorisedValues($ccode_avcode);
273
    my $ccodes = GetAuthorisedValues($ccode_avcode);
(-)a/cataloguing/value_builder/marc21_linking_section.pl (-2 / +3 lines)
Lines 32-38 use C4::Biblio; Link Here
32
use C4::Koha;
32
use C4::Koha;
33
use MARC::Record;
33
use MARC::Record;
34
use C4::Branch;
34
use C4::Branch;
35
use C4::ItemType;
35
36
use Koha::ItemTypes;
36
37
37
my $builder = sub {
38
my $builder = sub {
38
    my ( $params ) = @_;
39
    my ( $params ) = @_;
Lines 303-309 my $launcher = sub { Link Here
303
            }
304
            }
304
        );
305
        );
305
306
306
        my @itemtypes = C4::ItemType->all;
307
        my @itemtypes = Koha::ItemTypes->search;
307
308
308
        $template->param(
309
        $template->param(
309
            itypeloop => \@itemtypes,
310
            itypeloop => \@itemtypes,
(-)a/cataloguing/value_builder/unimarc_field_4XX.pl (-2 / +3 lines)
Lines 32-38 use C4::Biblio; Link Here
32
use C4::Koha;
32
use C4::Koha;
33
use MARC::Record;
33
use MARC::Record;
34
use C4::Branch;    # GetBranches
34
use C4::Branch;    # GetBranches
35
use C4::ItemType;
35
36
use Koha::ItemTypes;
36
37
37
sub plugin_javascript {
38
sub plugin_javascript {
38
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
39
    my ( $dbh, $record, $tagslib, $field_number, $tabloop ) = @_;
Lines 507-513 sub plugin { Link Here
507
            }
508
            }
508
        );
509
        );
509
510
510
        my @itemtypes = C4::ItemType->all;
511
        my @itemtypes = Koha::ItemTypes->search;
511
512
512
        $template->param(    #classlist => $classlist,
513
        $template->param(    #classlist => $classlist,
513
            itypeloop    => \@itemtypes,
514
            itypeloop    => \@itemtypes,
(-)a/circ/returns.pl (-5 / +5 lines)
Lines 265-280 if ($barcode) { Link Here
265
265
266
    # Check if we should display a checkin message, based on the the item
266
    # Check if we should display a checkin message, based on the the item
267
    # type of the checked in item
267
    # type of the checked in item
268
    my $itemtype = C4::ItemType->get( $biblio->{'itemtype'} );
268
    my $itemtype = Koha::ItemTypes->find( $biblio->{'itemtype'} );
269
    if ( $itemtype->{'checkinmsg'} ) {
269
    if ( $itemtype->checkinmsg ) {
270
        $template->param(
270
        $template->param(
271
            checkinmsg     => $itemtype->{'checkinmsg'},
271
            checkinmsg     => $itemtype->checkinmsg,
272
            checkinmsgtype => $itemtype->{'checkinmsgtype'},
272
            checkinmsgtype => $itemtype->checkinmsgtype,
273
        );
273
        );
274
    }
274
    }
275
275
276
    # make sure return branch respects home branch circulation rules, default to homebranch
276
    # make sure return branch respects home branch circulation rules, default to homebranch
277
    my $hbr = GetBranchItemRule($biblio->{'homebranch'}, $itemtype->{itemtype})->{'returnbranch'} || "homebranch";
277
    my $hbr = GetBranchItemRule($biblio->{'homebranch'}, $itemtype->itemtype)->{'returnbranch'} || "homebranch";
278
    my $returnbranch = $biblio->{$hbr} ;
278
    my $returnbranch = $biblio->{$hbr} ;
279
279
280
    $template->param(
280
    $template->param(
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/item_circulation_alerts.tt (-2 / +2 lines)
Lines 157-163 $(function(){ Link Here
157
<tr>
157
<tr>
158
  <th>&nbsp;</th>
158
  <th>&nbsp;</th>
159
  [% FOREACH item_type IN item_types %]
159
  [% FOREACH item_type IN item_types %]
160
  <th>[% item_type.br_description %]</th>
160
  <th>[% item_type.description %]</th>
161
  [% END %]
161
  [% END %]
162
</tr>
162
</tr>
163
</thead>
163
</thead>
Lines 181-187 $(function(){ Link Here
181
<tr>
181
<tr>
182
  <th>&nbsp;</th>
182
  <th>&nbsp;</th>
183
  [% FOREACH item_type IN item_types %]
183
  [% FOREACH item_type IN item_types %]
184
  <th>[% item_type.br_description %]</th>
184
  <th>[% item_type.description %]</th>
185
  [% END %]
185
  [% END %]
186
</tr>
186
</tr>
187
</thead>
187
</thead>
(-)a/t/db_dependent/HoldsQueue.t (-8 / +9 lines)
Lines 15-26 use Data::Dumper; Link Here
15
use Test::More tests => 23;
15
use Test::More tests => 23;
16
16
17
use C4::Branch;
17
use C4::Branch;
18
use C4::ItemType;
19
use C4::Members;
18
use C4::Members;
20
use Koha::Database;
19
use Koha::Database;
21
20
22
use t::lib::TestBuilder;
21
use t::lib::TestBuilder;
23
22
23
use Koha::ItemTypes;
24
24
BEGIN {
25
BEGIN {
25
    use FindBin;
26
    use FindBin;
26
    use lib $FindBin::Bin;
27
    use lib $FindBin::Bin;
Lines 60-68 my $borrower_branchcode = $borrower->{branchcode}; Link Here
60
my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} );
61
my @branchcodes = ( $library1->{branchcode}, $library2->{branchcode}, $library3->{branchcode} );
61
my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} );
62
my @other_branches = ( $library2->{branchcode}, $library3->{branchcode} );
62
my $least_cost_branch_code = pop @other_branches;
63
my $least_cost_branch_code = pop @other_branches;
63
my @item_types = C4::ItemType->all;
64
my $itemtype = Koha::ItemTypes->search({ notforloan => 1 })->next;
64
my $itemtype = grep { $_->{notforloan} == 1 } @item_types
65
$itemtype or BAIL_OUT("No adequate itemtype");
65
  or BAIL_OUT("No adequate itemtype");
66
67
# FIXME Should be $itemtype = $itemtype->itemtype
66
68
67
#Set up the stage
69
#Set up the stage
68
# Sysprefs and cost matrix
70
# Sysprefs and cost matrix
Lines 178-184 $dbh->do("DELETE FROM default_circ_rules"); Link Here
178
180
179
C4::Context->set_preference('UseTransportCostMatrix', 0);
181
C4::Context->set_preference('UseTransportCostMatrix', 0);
180
182
181
( $itemtype ) = @{ $dbh->selectrow_arrayref("SELECT itemtype FROM itemtypes LIMIT 1") };
183
$itemtype = Koha::ItemTypes->search->next->itemtype;
182
184
183
$library1 = $builder->build({
185
$library1 = $builder->build({
184
    source => 'Branch',
186
    source => 'Branch',
Lines 308-314 is( @$holds_queue, 3, "Holds queue filling correct number for holds for default Link Here
308
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue );
310
#warn "HOLDS QUEUE: " . Data::Dumper::Dumper( $holds_queue );
309
311
310
# Bug 14297
312
# Bug 14297
311
$itemtype = $item_types[0]->{itemtype};
313
$itemtype = Koha::ItemTypes->search->next->itemtype;
312
$borrowernumber = $borrower3->{borrowernumber};
314
$borrowernumber = $borrower3->{borrowernumber};
313
my $library_A = $library1->{branchcode};
315
my $library_A = $library1->{branchcode};
314
my $library_B = $library2->{branchcode};
316
my $library_B = $library2->{branchcode};
Lines 365-371 is( @$holds_queue, 1, "Bug 14297 - Holds Queue building ignoring holds where pic Link Here
365
# End Bug 14297
367
# End Bug 14297
366
368
367
# Bug 15062
369
# Bug 15062
368
$itemtype = $item_types[0]->{itemtype};
370
$itemtype = Koha::ItemTypes->search->next->itemtype;
369
$borrowernumber = $borrower2->{borrowernumber};
371
$borrowernumber = $borrower2->{borrowernumber};
370
$library_A = $library1->{branchcode};
372
$library_A = $library1->{branchcode};
371
$library_B = $library2->{branchcode};
373
$library_B = $library2->{branchcode};
372
- 

Return to bug 14828