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

(-)a/C4/Biblio.pm (+45 lines)
Lines 3064-3069 sub ModBiblioMarc { Link Here
3064
    $m_rs->metadata( $record->as_xml_record($encoding) );
3064
    $m_rs->metadata( $record->as_xml_record($encoding) );
3065
    $m_rs->store;
3065
    $m_rs->store;
3066
3066
3067
    UpdateItemsBundles($biblionumber, $record);
3068
3067
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
3069
    my $indexer = Koha::SearchEngine::Indexer->new({ index => $Koha::SearchEngine::BIBLIOS_INDEX });
3068
    $indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" );
3070
    $indexer->index_records( $biblionumber, "specialUpdate", "biblioserver" );
3069
3071
Lines 3300-3305 sub RemoveAllNsb { Link Here
3300
    return $record;
3302
    return $record;
3301
}
3303
}
3302
3304
3305
=head2 UpdateItemsBundles
3306
3307
Remove from items bundle the items that were removed from the MARC record (keep
3308
the table in sync with the MARC record)
3309
3310
This is called by ModBiblio
3311
3312
    UpdateItemsBundles($biblionumber, $record)
3313
3314
=cut
3315
3316
sub UpdateItemsBundles {
3317
    my ($biblionumber, $record) = @_;
3318
3319
    my $schema = Koha::Database->new()->schema();
3320
    my $items_bundle_rs = $schema->resultset('ItemsBundle');
3321
    my $items_rs = $schema->resultset('Item');
3322
    my $items_bundle = $items_bundle_rs->find({ biblionumber => $biblionumber });
3323
    return unless $items_bundle;
3324
3325
    my $tag = C4::Context->preference('marcflavour') eq 'UNIMARC' ? '462' : '774';
3326
    my @fields = $record->field($tag);
3327
    my %fields_by_itemnumber = map { (scalar $_->subfield('9')) // '' => $_ } @fields;
3328
3329
    foreach my $items_bundle_item ($items_bundle->items_bundle_items) {
3330
        my $itemnumber = $items_bundle_item->get_column('itemnumber');
3331
        if (not exists $fields_by_itemnumber{$itemnumber}) {
3332
            $items_bundle_item->itemnumber->update({ withdrawn => 0 });
3333
            $items_bundle_item->delete();
3334
        }
3335
    }
3336
3337
    my $items_count = $items_bundle->items_bundle_items->count();
3338
    # If bundle is empty, delete it
3339
    if ($items_count == 0) {
3340
        $items_bundle->delete();
3341
    }
3342
3343
    my $materials = $items_count || undef;
3344
    $items_rs->search({ biblionumber => $biblionumber })
3345
        ->update_all({ materials => $materials });
3346
}
3347
3303
1;
3348
1;
3304
3349
3305
3350
(-)a/C4/Items.pm (+6 lines)
Lines 510-515 sub GetItemsForInventory { Link Here
510
    my $minlocation  = $parameters->{'minlocation'}  // '';
510
    my $minlocation  = $parameters->{'minlocation'}  // '';
511
    my $maxlocation  = $parameters->{'maxlocation'}  // '';
511
    my $maxlocation  = $parameters->{'maxlocation'}  // '';
512
    my $class_source = $parameters->{'class_source'}  // C4::Context->preference('DefaultClassificationSource');
512
    my $class_source = $parameters->{'class_source'}  // C4::Context->preference('DefaultClassificationSource');
513
    my $items_bundle = $parameters->{'items_bundle'} // '';
513
    my $location     = $parameters->{'location'}     // '';
514
    my $location     = $parameters->{'location'}     // '';
514
    my $itemtype     = $parameters->{'itemtype'}     // '';
515
    my $itemtype     = $parameters->{'itemtype'}     // '';
515
    my $ignoreissued = $parameters->{'ignoreissued'} // '';
516
    my $ignoreissued = $parameters->{'ignoreissued'} // '';
Lines 555-560 sub GetItemsForInventory { Link Here
555
        push @bind_params, $max_cnsort;
556
        push @bind_params, $max_cnsort;
556
    }
557
    }
557
558
559
    if ($items_bundle) {
560
        push @where_strings, 'items.itemnumber IN (SELECT itemnumber FROM items_bundle_item WHERE items_bundle_id = ?)';
561
        push @bind_params, $items_bundle;
562
    }
563
558
    if ($datelastseen) {
564
    if ($datelastseen) {
559
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 });
565
        $datelastseen = output_pref({ str => $datelastseen, dateformat => 'iso', dateonly => 1 });
560
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
566
        push @where_strings, '(datelastseen < ? OR datelastseen IS NULL)';
(-)a/Koha/Template/Plugin/Biblio.pm (+9 lines)
Lines 63-66 sub CanArticleRequest { Link Here
63
    return $biblio ? $biblio->can_article_request( $borrower ) : 0;
63
    return $biblio ? $biblio->can_article_request( $borrower ) : 0;
64
}
64
}
65
65
66
sub IsItemsBundle {
67
    my ($self, $biblionumber) = @_;
68
69
    my $items_bundle_rs = Koha::Database->new()->schema()->resultset('ItemsBundle');
70
    my $count = $items_bundle_rs->search({ biblionumber => $biblionumber })->count;
71
72
    return $count > 0;
73
}
74
66
1;
75
1;
(-)a/admin/columns_settings.yml (+11 lines)
Lines 432-437 modules: Link Here
432
            -
432
            -
433
              columnname: checkin_on
433
              columnname: checkin_on
434
434
435
    items-bundle-contents:
436
      items-bundle-contents-table:
437
        columns:
438
          - columnname: title
439
          - columnname: author
440
          - columnname: ccode
441
          - columnname: itemtype
442
          - columnname: callnumber
443
          - columnname: barcode
444
          - columnname: status
445
435
  cataloguing:
446
  cataloguing:
436
    additem:
447
    additem:
437
      itemst:
448
      itemst:
(-)a/catalogue/detail.pl (+10 lines)
Lines 44-49 use Koha::AuthorisedValues; Link Here
44
use Koha::Biblios;
44
use Koha::Biblios;
45
use Koha::CoverImages;
45
use Koha::CoverImages;
46
use Koha::Illrequests;
46
use Koha::Illrequests;
47
use Koha::Database;
47
use Koha::Items;
48
use Koha::Items;
48
use Koha::ItemTypes;
49
use Koha::ItemTypes;
49
use Koha::Patrons;
50
use Koha::Patrons;
Lines 51-56 use Koha::Virtualshelves; Link Here
51
use Koha::Plugins;
52
use Koha::Plugins;
52
use Koha::SearchEngine::Search;
53
use Koha::SearchEngine::Search;
53
54
55
my $schema = Koha::Database->new()->schema();
56
54
my $query = CGI->new();
57
my $query = CGI->new();
55
58
56
my $analyze = $query->param('analyze');
59
my $analyze = $query->param('analyze');
Lines 411-416 foreach my $item (@items) { Link Here
411
        $item->{cover_images} = $item_object->cover_images;
414
        $item->{cover_images} = $item_object->cover_images;
412
    }
415
    }
413
416
417
    my $items_bundle_item = $schema->resultset('ItemsBundleItem')->find({ itemnumber => $item->{itemnumber} });
418
    if ($items_bundle_item) {
419
        $itemfields{items_bundle} = 1;
420
        $item->{items_bundle} = $items_bundle_item->items_bundle;
421
    }
422
414
    if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
423
    if ($currentbranch and C4::Context->preference('SeparateHoldings')) {
415
        if ($itembranchcode and $itembranchcode eq $currentbranch) {
424
        if ($itembranchcode and $itembranchcode eq $currentbranch) {
416
            push @itemloop, $item;
425
            push @itemloop, $item;
Lines 469-474 $template->param( Link Here
469
    itemdata_publisheddate => $itemfields{publisheddate},
478
    itemdata_publisheddate => $itemfields{publisheddate},
470
    volinfo                => $itemfields{enumchron},
479
    volinfo                => $itemfields{enumchron},
471
        itemdata_itemnotes  => $itemfields{itemnotes},
480
        itemdata_itemnotes  => $itemfields{itemnotes},
481
    itemdata_items_bundle => $itemfields{items_bundle},
472
        itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
482
        itemdata_nonpublicnotes => $itemfields{itemnotes_nonpublic},
473
    z3950_search_params    => C4::Search::z3950_search_args($dat),
483
    z3950_search_params    => C4::Search::z3950_search_args($dat),
474
        hostrecords         => $hostrecords,
484
        hostrecords         => $hostrecords,
(-)a/catalogue/items-bundle-contents.pl (+53 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use CGI qw(-utf8);
21
use C4::Auth;
22
use C4::Output;
23
24
use Koha::Database;
25
use Koha::Biblios;
26
use Koha::Items;
27
28
my $schema = Koha::Database->new()->schema();
29
30
my $cgi = CGI->new();
31
32
my ($template, $borrowernumber, $cookie) = get_template_and_user({
33
    template_name => 'catalogue/items-bundle-contents.tt',
34
    query => $cgi,
35
    type => 'intranet',
36
    authnotrequired => 0,
37
    flagsrequired => { catalogue => 1 },
38
});
39
40
my $biblionumber = $cgi->param('biblionumber');
41
my $biblio = Koha::Biblios->find($biblionumber);
42
43
my $items_bundle_rs = $schema->resultset('ItemsBundle');
44
my $items_bundle = $items_bundle_rs->find({ biblionumber => $biblionumber });
45
my @items = map { scalar Koha::Items->find($_->get_column('itemnumber')) } $items_bundle->items_bundle_items;
46
47
$template->param(
48
    biblionumber => $biblionumber,
49
    biblio => $biblio,
50
    items => \@items,
51
);
52
53
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/cataloguing/linkelements.pl (+144 lines)
Line 0 Link Here
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use CGI qw ( -utf8 );
21
use Encode;
22
use List::MoreUtils qw/uniq/;
23
use MARC::Record;
24
25
use Koha::Biblios;
26
use Koha::Items;
27
use Koha::Database;
28
29
use C4::Auth;
30
use C4::Output;
31
use C4::Biblio;
32
use C4::Context;
33
use C4::Items;
34
35
my $cgi = new CGI;
36
37
my ($template, $loggedinuser, $cookie) = get_template_and_user({
38
    template_name => 'cataloguing/linkelements.tt',
39
    query => $cgi,
40
    type => 'intranet',
41
    authnotrequired => 0,
42
    flagsrequired => { editcatalogue => 'edit_catalogue' },
43
});
44
45
my $biblionumber = $cgi->param('biblionumber');
46
my $sessionId = $cgi->cookie('CGISESSID');
47
my $session = C4::Auth::get_session($sessionId);
48
my $schema = Koha::Database->new()->schema();
49
my $items_bundle_rs = $schema->resultset('ItemsBundle');
50
my $items_bundle_item_rs = $schema->resultset('ItemsBundleItem');
51
52
if ($cgi->request_method() eq 'POST') {
53
    my $barcodelist = $cgi->param('barcodelist');
54
    my $withdrawn = $cgi->param('withdrawn');
55
    my @barcodes = uniq( split(/\s*\n\s*/, $barcodelist) );
56
    my @items;
57
    my @notfound_barcodes;
58
    my @found_barcodes;
59
    my @alreadylinked_barcodes;
60
    foreach my $barcode (@barcodes) {
61
        my $item = Koha::Items->find( { barcode => $barcode } );
62
        if ($item) {
63
            my $items_bundle_item = $items_bundle_item_rs->find({ itemnumber => $item->itemnumber });
64
            if ($items_bundle_item && $items_bundle_item->items_bundle->get_column('biblionumber') ne $biblionumber) {
65
                # This item is already linked to another biblio
66
                push @alreadylinked_barcodes, $barcode
67
            } else {
68
                push @items, $item;
69
                push @found_barcodes, $barcode;
70
            }
71
        } else {
72
            push @notfound_barcodes, $barcode;
73
        }
74
    }
75
76
    if (@items) {
77
        my $biblio = Koha::Biblios->find($biblionumber);
78
        my $record = GetMarcBiblio({ biblionumber => $biblionumber });
79
        my $tag = C4::Context->preference('marcflavour') eq 'UNIMARC' ? '462' : '774';
80
        foreach my $item (@items) {
81
            # Remove fields that references the same itemnumber
82
            # to avoid duplicates
83
            my @fields = $record->field($tag);
84
            my @duplicate_fields = grep {
85
                $_->subfield('9') eq $item->itemnumber;
86
            } @fields;
87
            $record->delete_fields(@duplicate_fields);
88
89
            my $field = MARC::Field->new($tag, '', '',
90
                't' => $item->biblio->title,
91
                '0' => $item->biblionumber,
92
                '9' => $item->itemnumber);
93
            $record->insert_fields_ordered($field);
94
95
            my $items_bundle = $items_bundle_rs->find_or_create({ biblionumber => $biblionumber });
96
            $items_bundle_item_rs->find_or_create({
97
                items_bundle_id => $items_bundle->items_bundle_id,
98
                itemnumber => $item->itemnumber,
99
            });
100
101
            if (defined $withdrawn and $withdrawn ne '') {
102
                $item->withdrawn($withdrawn)->store();
103
            }
104
        }
105
        ModBiblio($record, $biblionumber, $biblio->frameworkcode);
106
    }
107
108
    # Store barcodes in the session to display messages after the redirect
109
    $session->param('linkelements_notfound_barcodes', \@notfound_barcodes);
110
    $session->param('linkelements_found_barcodes', \@found_barcodes);
111
    $session->param('linkelements_alreadylinked_barcodes', \@alreadylinked_barcodes);
112
    $session->flush();
113
114
    print $cgi->redirect('/cgi-bin/koha/cataloguing/linkelements.pl?biblionumber=' . $biblionumber);
115
    exit;
116
}
117
118
my @notfound_barcodes = map {
119
    Encode::is_utf8($_) ? $_ : Encode::decode('UTF-8', $_)
120
} @{ $session->param('linkelements_notfound_barcodes') // [] };
121
122
my @found_barcodes = map {
123
    Encode::is_utf8($_) ? $_ : Encode::decode('UTF-8', $_)
124
} @{ $session->param('linkelements_found_barcodes') // [] };
125
126
my @alreadylinked_barcodes = map {
127
    Encode::is_utf8($_) ? $_ : Encode::decode('UTF-8', $_)
128
} @{ $session->param('linkelements_alreadylinked_barcodes') // [] };
129
130
$session->clear([
131
    'linkelements_notfound_barcodes',
132
    'linkelements_found_barcodes',
133
    'linkelements_alreadylinked_barcodes',
134
]);
135
$session->flush();
136
137
$template->param(
138
    biblionumber => $biblionumber,
139
    notfound_barcodes => \@notfound_barcodes,
140
    found_barcodes => \@found_barcodes,
141
    alreadylinked_barcodes => \@alreadylinked_barcodes,
142
);
143
144
output_html_with_http_headers $cgi, $cookie, $template->output;
(-)a/circ/returns.pl (+31 lines)
Lines 282-287 if ($barcode) { Link Here
282
            additional_materials => $materials,
282
            additional_materials => $materials,
283
            issue                => $checkout,
283
            issue                => $checkout,
284
        );
284
        );
285
286
        my $items_bundle_rs = Koha::Database->new->schema->resultset('ItemsBundle');
287
        my $items_bundle = $items_bundle_rs->find({ biblionumber => $biblio->biblionumber });
288
        if ($items_bundle) {
289
            my @items_bundle_items = map {
290
                scalar Koha::Items->find($_->get_column('itemnumber'))
291
            } $items_bundle->items_bundle_items;
292
293
            my $confirm = $query->param('confirm_items_bundle_return');
294
            unless ($confirm) {
295
                $template->param(
296
                    items_bundle_return_confirmation => 1,
297
                    items_bundle_items => \@items_bundle_items,
298
                );
299
300
                output_html_with_http_headers $query, $cookie, $template->output;
301
                exit;
302
            }
303
304
            my $mark_missing_items_as_lost = $query->param('confirm_items_bundle_mark_missing_items_as_lost');
305
            if ($mark_missing_items_as_lost) {
306
                my $barcodes = $query->param('verify-items-bundle-contents-barcodes');
307
                my $lost = $query->param('verify-items-bundle-contents-lost');
308
                my @barcodes = map { s/^\s+|\s+$//gr } (split /\n/, $barcodes);
309
                foreach my $item (@items_bundle_items) {
310
                    unless (grep { $_ eq $item->barcode } @barcodes) {
311
                        $item->itemlost($lost)->store();
312
                    }
313
                }
314
            }
315
        }
285
    } # FIXME else we should not call AddReturn but set BadBarcode directly instead
316
    } # FIXME else we should not call AddReturn but set BadBarcode directly instead
286
317
287
    my %input = (
318
    my %input = (
(-)a/installer/data/mysql/atomicupdate/bug-24023-items-bundles.perl (+37 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
    $dbh->do(q{
4
        CREATE TABLE IF NOT EXISTS items_bundle (
5
            items_bundle_id SERIAL,
6
            biblionumber INT NOT NULL,
7
            CONSTRAINT pk_items_bundle_items_bundle_id
8
                PRIMARY KEY (items_bundle_id),
9
            CONSTRAINT fk_items_bundle_biblio_biblionumber
10
                FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber)
11
                ON DELETE CASCADE ON UPDATE CASCADE,
12
            CONSTRAINT uniq_items_bundle_biblionumber
13
                UNIQUE KEY (biblionumber)
14
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
15
    });
16
17
    $dbh->do(q{
18
        CREATE TABLE IF NOT EXISTS items_bundle_item (
19
            items_bundle_item_id SERIAL,
20
            items_bundle_id BIGINT UNSIGNED NOT NULL,
21
            itemnumber INT NOT NULL,
22
            CONSTRAINT pk_items_bundle_item_items_bundle_item_id
23
                PRIMARY KEY (items_bundle_item_id),
24
            CONSTRAINT fk_items_bundle_item_itemnumber
25
                FOREIGN KEY (itemnumber) REFERENCES items (itemnumber)
26
                ON DELETE CASCADE ON UPDATE CASCADE,
27
            CONSTRAINT fk_items_bundle_item_items_bundle_id
28
                FOREIGN KEY (items_bundle_id) REFERENCES items_bundle (items_bundle_id)
29
                ON DELETE CASCADE ON UPDATE CASCADE,
30
            CONSTRAINT uniq_items_bundle_item_itemnumber
31
                UNIQUE KEY (itemnumber)
32
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci
33
    });
34
35
    SetVersion( $DBversion );
36
    print "Upgrade to $DBversion done (Bug 24023 - Items bundles)\n";
37
}
(-)a/installer/data/mysql/kohastructure.sql (+38 lines)
Lines 4690-4695 CREATE TABLE background_jobs ( Link Here
4690
    PRIMARY KEY (id)
4690
    PRIMARY KEY (id)
4691
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4691
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4692
4692
4693
--
4694
-- Table structure for table items_bundle
4695
--
4696
4697
DROP TABLE IF EXISTS items_bundle;
4698
CREATE TABLE items_bundle (
4699
    items_bundle_id SERIAL,
4700
    biblionumber INT NOT NULL,
4701
    CONSTRAINT pk_items_bundle_items_bundle_id
4702
        PRIMARY KEY (items_bundle_id),
4703
    CONSTRAINT fk_items_bundle_biblio_biblionumber
4704
        FOREIGN KEY (biblionumber) REFERENCES biblio (biblionumber)
4705
        ON DELETE CASCADE ON UPDATE CASCADE,
4706
    CONSTRAINT uniq_items_bundle_biblionumber
4707
        UNIQUE KEY (biblionumber)
4708
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4709
4710
--
4711
-- Table structure for table items_bundle_item
4712
--
4713
4714
DROP TABLE IF EXISTS items_bundle_item;
4715
CREATE TABLE items_bundle_item (
4716
    items_bundle_item_id SERIAL,
4717
    items_bundle_id BIGINT UNSIGNED NOT NULL,
4718
    itemnumber INT NOT NULL,
4719
    CONSTRAINT pk_items_bundle_item_items_bundle_item_id
4720
        PRIMARY KEY (items_bundle_item_id),
4721
    CONSTRAINT fk_items_bundle_item_itemnumber
4722
        FOREIGN KEY (itemnumber) REFERENCES items (itemnumber)
4723
        ON DELETE CASCADE ON UPDATE CASCADE,
4724
    CONSTRAINT fk_items_bundle_item_items_bundle_id
4725
        FOREIGN KEY (items_bundle_id) REFERENCES items_bundle (items_bundle_id)
4726
        ON DELETE CASCADE ON UPDATE CASCADE,
4727
    CONSTRAINT uniq_items_bundle_item_itemnumber
4728
        UNIQUE KEY (itemnumber)
4729
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4730
4693
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4731
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4694
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4732
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4695
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4733
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc (+7 lines)
Lines 1-5 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Biblio %]
2
[% USE Biblio %]
3
[% PROCESS 'i18n.inc' %]
3
[% SET biblio_object_id = object || biblionumber || biblio.biblionumber %]
4
[% SET biblio_object_id = object || biblionumber || biblio.biblionumber %]
4
5
5
<div id="menu">
6
<div id="menu">
Lines 41-45 Link Here
41
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id | url  %]" >Checkout history</a></li>
42
<a href="/cgi-bin/koha/catalogue/issuehistory.pl?biblionumber=[% biblio_object_id | url  %]" >Checkout history</a></li>
42
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id | url  %]&amp;object_type=biblio">Modification log</a> </li>[% END %]
43
[% IF ( CAN_user_tools_view_system_logs ) %][% IF ( logview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/tools/viewlog.pl?do_it=1&amp;modules=CATALOGUING&amp;action=MODIFY&amp;object=[% biblio_object_id | url  %]&amp;object_type=biblio">Modification log</a> </li>[% END %]
43
[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/stockrotation.pl?biblionumber=[% biblio_object_id | uri %]">Rota</a> </li>[% END %]
44
[% IF ( CAN_user_stockrotation_manage_rota_items && Koha.Preference('StockRotation') ) %][% IF ( stockrotationview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/catalogue/stockrotation.pl?biblionumber=[% biblio_object_id | uri %]">Rota</a> </li>[% END %]
45
46
[% IF Biblio.IsItemsBundle(biblio_object_id) %]
47
    [% IF items_bundle_contents_view %]<li class="active">[% ELSE %]<li>[% END %]
48
        <a href="/cgi-bin/koha/catalogue/items-bundle-contents.pl?biblionumber=[% biblio_object_id | uri %]">[% t('Item bundle contents') | html %]</a>
49
    </li>
50
[% END %]
44
</ul>
51
</ul>
45
</div>
52
</div>
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc (+1 lines)
Lines 63-68 CAN_user_serials_create_subscription ) %] Link Here
63
63
64
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
64
            [% IF ( CAN_user_editcatalogue_edit_catalogue ) %]
65
                <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
65
                <li><a id="duplicatebiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]&amp;op=duplicate">Edit as new (duplicate)</a></li>
66
                <li><a id="linkelements" href="/cgi-bin/koha/cataloguing/linkelements.pl?biblionumber=[% biblionumber | html %]&amp;frameworkcode=[% current_framework | html %]">Link elements</a></li>
66
                <li><a href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li>
67
                <li><a href="#" id="z3950copy">Replace record via Z39.50/SRU</a></li>
67
            [% END %]
68
            [% END %]
68
69
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/item-status.inc (+84 lines)
Line 0 Link Here
1
[% USE AuthorisedValues %]
2
[% USE Branches %]
3
[% USE Koha %]
4
[% USE KohaDates %]
5
[% PROCESS 'i18n.inc' %]
6
[% transfer = item.get_transfer() %]
7
[% IF item.checkout %]
8
    <span class="datedue">
9
        [% IF item.checkout.onsite_checkout %]
10
            [% t('Currently in local use by') | html %]
11
        [% ELSE %]
12
            [% t('Checked out to') | html %]
13
        [% END %]
14
        [% INCLUDE 'patron-title.inc' patron=item.checkout.patron hide_patron_infos_if_needed=1 %]
15
        : [% tx('due {date_due}', { date_due = item.checkout.date_due }) | html %]
16
    </span>
17
[% ELSIF transfer %]
18
    [% datesent = BLOCK %][% transfer.datesent | $KohaDates %][% END %]
19
    <span class="intransit">[% tx('In transit from {frombranch} to {tobranch} since {datesent}', { frombranch = Branches.GetName(transfer.frombranch), tobranch = Branches.GetName(transfer.tobranch), datesent = datesent }) %]</span>
20
[% END %]
21
22
[% IF item.itemlost %]
23
    [% itemlost_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.itemlost', authorised_value = item.itemlost }) %]
24
    [% IF itemlost_description %]
25
        <span class="lost">[% itemlost_description | html %]</span>
26
    [% ELSE %]
27
        <span class="lost">[% t('Unavailable (lost or missing)') | html %]</span>
28
    [% END %]
29
[% END %]
30
31
[% IF item.withdrawn %]
32
    [% withdrawn_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.withdrawn', authorised_value = item.withdrawn }) %]
33
    [% IF withdrawn_description %]
34
        <span class="wdn">[% withdrawn_description | html %]</span>
35
    [% ELSE %]
36
        <span class="wdn">[% t('Withdrawn') | html %]</span>
37
    [% END %]
38
[% END %]
39
40
[% IF item.damaged %]
41
    [% damaged_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.damaged', authorised_value = item.damaged }) %]
42
    [% IF damaged_description %]
43
        <span class="dmg">[% damaged_description | html %]</span>
44
    [% ELSE %]
45
        <span class="dmg">[% t('Damaged') | html %]</span>
46
    [% END %]
47
[% END %]
48
49
[% IF item.notforloan || item.effective_itemtype.notforloan %]
50
    <span>
51
        [% t('Not for loan') | html %]
52
        [% notforloan_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.notforloan', authorised_value = item.notforloan }) %]
53
        [% IF notforloan_description %]
54
            ([% notforloan_description | html %])
55
        [% END %]
56
    </span>
57
[% END %]
58
59
[% hold = item.holds.next %]
60
[% IF hold %]
61
    <span>
62
        [% IF hold.waitingdate %]
63
            Waiting at [% Branches.GetName(hold.get_column('branchcode')) | html %] since [% hold.waitingdate | $KohaDates %].
64
        [% ELSE %]
65
            Item-level hold (placed [% hold.reservedate | $KohaDates %]) for delivery at [% Branches.GetName(hold.get_column('branchcode')) | html %].
66
        [% END %]
67
        [% IF Koha.Preference('canreservefromotherbranches') %]
68
            [% t('Hold for:') | html %]
69
            [% INCLUDE 'patron-title.inc' patron=hold.borrower hide_patron_infos_if_needed=1 %]
70
        [% END %]
71
    </span>
72
[% END %]
73
[% UNLESS item.notforloan || item.effective_itemtype.notforloan || item.onloan || item.itemlost || item.withdrawn || item.damaged || transfer || hold %]
74
    <span>[% t('Available') | html %]</span>
75
[% END %]
76
77
[% IF ( item.restricted ) %]
78
    [% restricted_description = AuthorisedValues.GetDescriptionByKohaField({ kohafield = 'items.restricted', authorised_value = item.restricted }) %]
79
    [% IF restricted_description %]
80
        <span class="restricted">([% restricted_description | html %])</span>
81
    [% ELSE %]
82
        <span class="restricted">[% t('Restricted') | html %]</span>
83
    [% END %]
84
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (+9 lines)
Lines 316-321 Link Here
316
                [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
316
                [% IF ( hostrecords ) %]<th id="[% tab | html %]_hostrecord" data-colname="[% tab | html %]_hostrecord">Host records</th>[% END %]
317
                [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
317
                [% IF ( analyze ) %]<th id="[% tab | html %]_usedin" data-colname="[% tab | html %]_usedin">Used in</th><th></th>[% END %]
318
                [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
318
                [% IF ( ShowCourseReserves ) %]<th id="[% tab | html %]_course_reserves" data-colname="[% tab | html %]_course_reserves">Course reserves</th>[% END %]
319
                [% IF itemdata_items_bundle %]<th id="[% tab | html %]_items_bundle" data-colname="[% tab | html %]_items_bundle">Items bundle</th>[% END %]
319
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
320
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th id="[% tab | html %]_spinelabel" data-colname="[% tab | html %]_spinelabel" class="NoSort">Spine label</th>[% END %]
320
                [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort">&nbsp;</th>[% END %]
321
                [% IF ( CAN_user_editcatalogue_edit_items ) %]<th id="[% tab | html %]_actions" data-colname="[% tab | html %]_actions"class="NoSort">&nbsp;</th>[% END %]
321
            </tr>
322
            </tr>
Lines 547-552 Note that permanent location is a code, and location may be an authval. Link Here
547
                    </td>
548
                    </td>
548
                [% END %]
549
                [% END %]
549
550
551
                [% IF itemdata_items_bundle %]
552
                    <td>
553
                        [% IF item.items_bundle.biblionumber %]
554
                            [% INCLUDE 'biblio-title.inc' biblio = item.items_bundle.biblionumber link = 1 %]
555
                        [% END %]
556
                    </td>
557
                [% END %]
558
550
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]
559
                [% IF ( SpineLabelShowPrintOnBibDetails ) %]
551
                    <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
560
                    <td><a class="btn btn-default btn-xs print-label" href="/cgi-bin/koha/labels/spinelabel-print.pl?barcode=[% item.barcode | uri %]"><i class="fa fa-print"></i> Print label</a></td>
552
                [% END %]
561
                [% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/items-bundle-contents.tt (+79 lines)
Line 0 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE AuthorisedValues %]
4
[% USE ItemTypes %]
5
[% USE TablesSettings %]
6
7
[% INCLUDE 'doc-head-open.inc' %]
8
<title>Koha &rsaquo; Catalog &rsaquo; Items bundle contents for [% INCLUDE 'biblio-title-head.inc' %]</title>
9
[% INCLUDE 'doc-head-close.inc' %]
10
</head>
11
12
<body id="catalog_items_bundle_contents" class="catalog">
13
14
[% INCLUDE 'header.inc' %]
15
[% INCLUDE 'cat-search.inc' %]
16
17
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Items bundle contents for <i>[% INCLUDE 'biblio-title.inc' %]</i></div>
18
19
<div class="main container-fluid">
20
    <div class="row">
21
        <div class="col-sm-10 col-sm-push-2">
22
            [% INCLUDE 'cat-toolbar.inc' %]
23
24
            <h1>Items bundle contents for [% INCLUDE 'biblio-title.inc' %]</h1>
25
26
            <main>
27
                <table id="items-bundle-contents-table">
28
                    <thead>
29
                        <tr>
30
                            <th>Title</th>
31
                            <th>Author</th>
32
                            <th>Collection code</th>
33
                            <th>Item type</th>
34
                            <th>Callnumber</th>
35
                            <th>Barcode</th>
36
                            <th>Status</th>
37
                        </tr>
38
                    </thead>
39
                    <tbody>
40
                        [% FOREACH item IN items %]
41
                            <tr>
42
                                <td>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %]</td>
43
                                <td>[% item.biblio.author | html %]</td>
44
                                <td>[% AuthorisedValues.GetByCode('CCODE', item.ccode) | html %]</td>
45
                                <td>[% ItemTypes.GetDescription(item.itype) | html %]</td>
46
                                <td>[% item.itemcallnumber | html %]</td>
47
                                <td>[% item.barcode | html %]</td>
48
                                <td>[% INCLUDE 'item-status.inc' item=item %]</td>
49
                            </tr>
50
                        [% END %]
51
                    </tbody>
52
                </table>
53
            </main>
54
        </div>
55
56
        <div class="col-sm-2 col-sm-pull-10">
57
            <aside>
58
                [% INCLUDE 'biblio-view-menu.inc' items_bundle_contents_view = 1 %]
59
            </aside>
60
        </div>
61
     </div>
62
63
    [% Asset.js('js/table_filters.js') | $raw %]
64
    [% Asset.js('lib/jquery/plugins/jquery.dataTables.columnFilter.js') | $raw %]
65
    [% INCLUDE 'datatables.inc' %]
66
    [% INCLUDE 'columns_settings.inc' %]
67
    <script>
68
        $(document).ready(function () {
69
            var columns_settings = [% TablesSettings.GetColumns('catalogue', 'items-bundle-contents', 'items-bundle-contents-table', 'json') | $raw %];
70
            KohaTable('items-bundle-contents-table', {
71
                dom: '<"pager"<"table_entries"ilp><"table_controls"B>>tr',
72
                pagingType: 'full',
73
                autoWidth: false,
74
            }, columns_settings, true);
75
            activate_filters('items-bundle-contents-table');
76
        });
77
    </script>
78
79
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/linkelements.tt (+91 lines)
Line 0 Link Here
1
[% USE AuthorisedValues %]
2
[% PROCESS 'i18n.inc' %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Link elements together</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
</head>
7
<body id="tools_batchMod" class="tools">
8
[% INCLUDE 'header.inc' %]
9
[% INCLUDE 'cat-search.inc' %]
10
11
<div id="breadcrumbs">
12
    <a href="/cgi-bin/koha/mainpage.pl">[% t('Home') | html %]</a> &rsaquo;
13
    <a href="/cgi-bin/koha/cataloguing/addbooks.pl">[% t('Cataloguing') | html %]</a> &rsaquo;
14
    [% t('Link elements to the biblio') | html %]
15
</div>
16
17
[% BLOCK barcodes_table %]
18
    <table>
19
        <thead>
20
            <tr>
21
                <th>[% t('Barcode') | html %]</th>
22
            </tr>
23
        </thead>
24
        <tbody>
25
            [% FOREACH barcode IN barcodes %]
26
                <tr>
27
                    <td>[% barcode | html %]</td>
28
                </tr>
29
            [% END %]
30
        </tbody>
31
    </table>
32
[% END %]
33
34
<div class="main container-fluid">
35
    <div class="row">
36
        <div class="col-sm-10 col-sm-push-2">
37
            <main>
38
                <h1>[% t('Link elements to the biblio') | html %]</h1>
39
40
                [% IF ( notfound_barcodes ) %]
41
                    <div class="dialog alert">
42
                        <p>[% t('Warning: the following barcodes were not found:') | html %]</p>
43
                        [% PROCESS barcodes_table barcodes = notfound_barcodes %]
44
                    </div>
45
                [% END %]
46
47
                [% IF ( alreadylinked_barcodes ) %]
48
                    <div class="dialog alert">
49
                        <p>[% t('Warning: the following barcodes are already linked to another biblio') | html %]</p>
50
                        [% PROCESS barcodes_table barcodes = alreadylinked_barcodes %]
51
                    </div>
52
                [% END %]
53
54
                [% IF found_barcodes %]
55
                    <div class="dialog message">
56
                        <p>[% t('The following barcodes were linked:') | html %]</p>
57
58
                        [% PROCESS barcodes_table barcodes = found_barcodes %]
59
                    </div>
60
                [% END %]
61
62
                <form method="post" action="/cgi-bin/koha/cataloguing/linkelements.pl">
63
                    <fieldset class="rows">
64
                        <legend>[% t('Items') | html %]</legend>
65
                        <ol>
66
                            <li>
67
                              <label for="barcodelist">[% t('Barcode list (one barcode per line):') | html %] </label>
68
                              <textarea rows="10" cols="30" id="barcodelist" name="barcodelist"></textarea>
69
                            </li>
70
                            <li>
71
                                <label for="withdrawn">[% t('Change withdrawn status to') | html %]</label>
72
                                <select id="withdrawn" name="withdrawn">
73
                                    <option value=""></option>
74
                                    [% FOREACH av IN AuthorisedValues.Get('WITHDRAWN') %]
75
                                        <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
76
                                    [% END %]
77
                                </select>
78
                            </li>
79
                        </ol>
80
                        <input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
81
                    </fieldset>
82
83
                    <fieldset class="action">
84
                        <input type="submit" value="Continue" class="button" />
85
                        <a class="cancel" href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblionumber | url %]">Cancel</a>
86
                    </fieldset>
87
                </form>
88
            </main>
89
        </div>
90
    </div>
91
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt (+92 lines)
Lines 6-11 Link Here
6
[% USE ItemTypes %]
6
[% USE ItemTypes %]
7
[% USE AuthorisedValues %]
7
[% USE AuthorisedValues %]
8
[% USE TablesSettings %]
8
[% USE TablesSettings %]
9
[% PROCESS 'i18n.inc' %]
9
[% PROCESS 'member-display-address-style.inc' %]
10
[% PROCESS 'member-display-address-style.inc' %]
10
[% SET footerjs = 1 %]
11
[% SET footerjs = 1 %]
11
[% BLOCK display_bormessagepref %]
12
[% BLOCK display_bormessagepref %]
Lines 703-708 Link Here
703
                            [% INCLUDE all_checkin_messages %]
704
                            [% INCLUDE all_checkin_messages %]
704
                        </div>
705
                        </div>
705
706
707
                        [% IF items_bundle_return_confirmation %]
708
                            <div class="dialog alert">[% t('The returned item is an items bundle and needs confirmation') | html %]</div>
709
710
                            <table class="table table-condensed table-bordered" id="items-bundle-contents-table">
711
                                <thead>
712
                                    <tr>
713
                                        <th>[% t('Title') | html %]</th>
714
                                        <th>[% t('Author') | html %]</th>
715
                                        <th>[% t('Collection code') | html %]</th>
716
                                        <th>[% t('Item type') | html %]</th>
717
                                        <th>[% t('Callnumber') | html %]</th>
718
                                        <th>[% t('Barcode') | html %]</th>
719
                                        <th>[% t('Status') | html %]</th>
720
                                    </tr>
721
                                </thead>
722
                                <tbody>
723
                                    [% FOREACH item IN items_bundle_items %]
724
                                        <tr data-barcode="[% item.barcode | html %]">
725
                                            <td>[% INCLUDE 'biblio-title.inc' biblio=item.biblio link = 1 %]</td>
726
                                            <td>[% item.biblio.author | html %]</td>
727
                                            <td>[% AuthorisedValues.GetByCode('CCODE', item.ccode) | html %]</td>
728
                                            <td>[% ItemTypes.GetDescription(item.itype) | html %]</td>
729
                                            <td>[% item.itemcallnumber | html %]</td>
730
                                            <td>[% item.barcode | html %]</td>
731
                                            <td>[% INCLUDE 'item-status.inc' item=item %]</td>
732
                                        </tr>
733
                                    [% END %]
734
                                </tbody>
735
                            </table>
736
737
                            <div id="items-bundle-confirmation-action">
738
                                <form method="post">
739
                                    <input type="hidden" name="barcode" value="[% itembarcode | html %]">
740
                                    <input type="hidden" name="confirm_items_bundle_return" value="1">
741
                                    <button class="btn btn-default" type="submit"><i class="fa fa-check"></i> [% t('Confirm checkin without verifying') | html %]</button>
742
                                </form>
743
744
                                <button id="verify-items-bundle-contents-button" class="btn btn-default">[% t('Verify items bundle contents') | html %]</button>
745
                            </div>
746
747
                            <div id="verify-items-bundle-contents-form-wrapper">
748
                                <form method="post">
749
                                    <div class="form-group">
750
                                        <label for="verify-items-bundle-contents-barcodes">Barcodes</label>
751
                                        <textarea autocomplete="off" id="verify-items-bundle-contents-barcodes" name="verify-items-bundle-contents-barcodes" class="form-control"></textarea>
752
                                        <div class="help-block">[% t('Scan barcodes found in the items bundle and compare it to the table above') | html %]</div>
753
                                    </div>
754
755
                                    <div class="form-group">
756
                                        <label for="verify-items-bundle-contents-lost">[% t('Lost status') | html %]</label>
757
                                        <select id="verify-items-bundle-contents-lost" name="verify-items-bundle-contents-lost" class="form-control">
758
                                            [% FOREACH av IN AuthorisedValues.Get('LOST') %]
759
                                                <option value="[% av.authorised_value | html %]">[% av.lib | html %]</option>
760
                                            [% END %]
761
                                        </select>
762
                                        <div class="help-block">[% t('If some items are missing, they will be marked as lost with this status') | html %]</div>
763
                                    </div>
764
                                    <input type="hidden" name="barcode" value="[% itembarcode | html %]">
765
                                    <input type="hidden" name="confirm_items_bundle_return" value="1">
766
                                    <input type="hidden" name="confirm_items_bundle_mark_missing_items_as_lost" value="1">
767
                                    <button type="submit" class="btn btn-default"><i class="fa fa-check"></i> [% t('Confirm checkin and mark missing items as lost') | html %]</button>
768
                                    <button type="button" class="btn btn-default" id="verify-items-bundle-contents-cancel-button"><i class="fa fa-close"></i> [% t('Cancel') | html %]</button>
769
                                </form>
770
                            </div>
771
                        [% END %]
772
706
                        <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
773
                        <form id="checkin-form" method="post" action="/cgi-bin/koha/circ/returns.pl" autocomplete="off" >
707
                            <fieldset id="circ_returns_checkin">
774
                            <fieldset id="circ_returns_checkin">
708
                                <div class="show_checkin_dialog" style="float:right;display:none"><button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="Show the last checkin message"><i class="fa fa-info"></i></button></div>
775
                                <div class="show_checkin_dialog" style="float:right;display:none"><button type="button" class="btn btn-default btn-sm" data-toggle="tooltip" title="Show the last checkin message"><i class="fa fa-info"></i></button></div>
Lines 1122-1127 Link Here
1122
            $('[data-toggle="tooltip"]').tooltip();
1189
            $('[data-toggle="tooltip"]').tooltip();
1123
        });
1190
        });
1124
    </script>
1191
    </script>
1192
1193
    <script>
1194
        $(document).ready(function () {
1195
            $('#verify-items-bundle-contents-form-wrapper').hide();
1196
            $('#verify-items-bundle-contents-button').on('click', function () {
1197
                $('#verify-items-bundle-contents-form-wrapper').show();
1198
                $('#items-bundle-confirmation-action').hide();
1199
            });
1200
            $('#verify-items-bundle-contents-cancel-button').on('click', function () {
1201
                $('#verify-items-bundle-contents-form-wrapper').hide();
1202
                $('#items-bundle-confirmation-action').show();
1203
            });
1204
            $('#verify-items-bundle-contents-barcodes').on('input', function (ev) {
1205
                const barcodes = ev.target.value.split('\n').map(function(s) { return s.trim() });
1206
                $('#items-bundle-contents-table tr').each(function () {
1207
                    const barcode = this.getAttribute('data-barcode');
1208
                    if (barcodes.includes(barcode)) {
1209
                        this.classList.add('ok');
1210
                    } else {
1211
                        this.classList.remove('ok');
1212
                    }
1213
                })
1214
            });
1215
        });
1216
    </script>
1125
[% END %]
1217
[% END %]
1126
1218
1127
[% INCLUDE 'intranet-bottom.inc' %]
1219
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt (-1 / +19 lines)
Lines 107-112 Link Here
107
            [% END %]
107
            [% END %]
108
            </select>
108
            </select>
109
          </li>
109
          </li>
110
        [% IF items_bundles.size > 0 %]
111
            <li>
112
                <label for="items_bundle">Items bundle:</label>
113
                <select id="items_bundle" name="items_bundle">
114
                    <option value=""></option>
115
                    [% FOREACH items_bundle IN items_bundles %]
116
                        <option value="[% items_bundle.items_bundle_id | html %]">[% items_bundle.biblionumber.title | html %]</option>
117
                    [% END %]
118
                </select>
119
            </li>
120
        [% END %]
110
    </ol>
121
    </ol>
111
    </fieldset>
122
    </fieldset>
112
123
Lines 302-308 Link Here
302
                    $('#locationloop').val() ||
313
                    $('#locationloop').val() ||
303
                    $('#minlocation').val()  ||
314
                    $('#minlocation').val()  ||
304
                    $('#maxlocation').val()  ||
315
                    $('#maxlocation').val()  ||
305
                    $('#statuses input:checked').length
316
                    $('#statuses input:checked').length ||
317
                    $('#items_bundle').val()
306
                ) ) {
318
                ) ) {
307
                    return confirm(
319
                    return confirm(
308
                        _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
320
                        _("You have not selected any catalog filters and are about to compare a file of barcodes to your entire catalog.") + "\n\n" +
Lines 435-440 Link Here
435
            });
447
            });
436
        });
448
        });
437
    </script>
449
    </script>
450
    [% INCLUDE 'select2.inc' %]
451
    <script>
452
        $(document).ready(function () {
453
            $('#items_bundle').select2();
454
        });
455
    </script>
438
[% END %]
456
[% END %]
439
457
440
[% INCLUDE 'intranet-bottom.inc' %]
458
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/tools/inventory.pl (-1 / +10 lines)
Lines 48-53 my $minlocation=$input->param('minlocation') || ''; Link Here
48
my $maxlocation=$input->param('maxlocation');
48
my $maxlocation=$input->param('maxlocation');
49
my $class_source=$input->param('class_source');
49
my $class_source=$input->param('class_source');
50
$maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation );
50
$maxlocation=$minlocation.'Z' unless ( $maxlocation || ! $minlocation );
51
my $items_bundle = $input->param('items_bundle');
51
my $location=$input->param('location') || '';
52
my $location=$input->param('location') || '';
52
my $ignoreissued=$input->param('ignoreissued');
53
my $ignoreissued=$input->param('ignoreissued');
53
my $ignore_waiting_holds = $input->param('ignore_waiting_holds');
54
my $ignore_waiting_holds = $input->param('ignore_waiting_holds');
Lines 68-73 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
68
    }
69
    }
69
);
70
);
70
71
72
my $schema = Koha::Database->new()->schema();
73
my $items_bundle_rs = $schema->resultset('ItemsBundle');
74
my @items_bundles = $items_bundle_rs->search(undef, {
75
    order_by => { -asc => ['biblionumber.title'] },
76
    join => ['biblionumber'],
77
});
71
my @authorised_value_list;
78
my @authorised_value_list;
72
my $authorisedvalue_categories = '';
79
my $authorisedvalue_categories = '';
73
80
Lines 129-134 my $pref_class = C4::Context->preference("DefaultClassificationSource"); Link Here
129
136
130
$template->param(
137
$template->param(
131
    authorised_values        => \@authorised_value_list,
138
    authorised_values        => \@authorised_value_list,
139
    items_bundles            => \@items_bundles,
132
    today                    => dt_from_string,
140
    today                    => dt_from_string,
133
    minlocation              => $minlocation,
141
    minlocation              => $minlocation,
134
    maxlocation              => $maxlocation,
142
    maxlocation              => $maxlocation,
Lines 243-248 if ( $op && ( !$uploadbarcodes || $compareinv2barcd )) { Link Here
243
      minlocation  => $minlocation,
251
      minlocation  => $minlocation,
244
      maxlocation  => $maxlocation,
252
      maxlocation  => $maxlocation,
245
      class_source => $class_source,
253
      class_source => $class_source,
254
      items_bundle => $items_bundle,
246
      location     => $location,
255
      location     => $location,
247
      ignoreissued => $ignoreissued,
256
      ignoreissued => $ignoreissued,
248
      datelastseen => $datelastseen,
257
      datelastseen => $datelastseen,
Lines 260-265 if( @scanned_items ) { Link Here
260
      maxlocation  => $maxlocation,
269
      maxlocation  => $maxlocation,
261
      class_source => $class_source,
270
      class_source => $class_source,
262
      location     => $location,
271
      location     => $location,
272
      items_bundle => $items_bundle,
263
      ignoreissued => undef,
273
      ignoreissued => undef,
264
      datelastseen => undef,
274
      datelastseen => undef,
265
      branchcode   => $branchcode,
275
      branchcode   => $branchcode,
266
- 

Return to bug 24023