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

(-)a/Koha/Import/Record.pm (-1 / +1 lines)
Lines 132-138 sub replace { Link Here
132
    if ($biblio) {
132
    if ($biblio) {
133
        my $record = $biblio->metadata->record;
133
        my $record = $biblio->metadata->record;
134
        $xmlrecord = $record->as_xml;
134
        $xmlrecord = $record->as_xml;
135
        my $context = { source => 'batchimport' };
135
        my $context = { source => 'add_to_basket' };
136
        if ($logged_in_patron) {
136
        if ($logged_in_patron) {
137
            $context->{categorycode} = $logged_in_patron->categorycode;
137
            $context->{categorycode} = $logged_in_patron->categorycode;
138
            $context->{userid}       = $logged_in_patron->userid;
138
            $context->{userid}       = $logged_in_patron->userid;
(-)a/installer/data/mysql/atomicupdate/bug_41029.pl (+40 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "41029",
6
    description => "Add 'add_to_basket' source option for MARC overlay rules",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        my $existing_batchimport_rules_count = (
12
            $dbh->selectrow_array(
13
                'SELECT COUNT(*) FROM marc_overlay_rules WHERE module="source" and filter="batchimport"', undef
14
            )
15
        )[0];
16
        my $existing_add_to_basket_rules_count = (
17
            $dbh->selectrow_array(
18
                'SELECT COUNT(*) FROM marc_overlay_rules WHERE module="source" and filter="add_to_basket"', undef
19
            )
20
        )[0];
21
        if ( $existing_batchimport_rules_count > 0 && $existing_add_to_basket_rules_count == 0 ) {
22
            say_info( $out, "Existing batchimport marc_overlay_rules found and no add_to_basket rules found" );
23
            $dbh->do(
24
                q{
25
                INSERT INTO marc_overlay_rules (`tag`, `module`, `filter`, `add`, `append`, `remove`, `delete`)
26
                SELECT `tag`, `module`, "add_to_basket", `add`, `append`, `remove`, `delete`
27
                FROM marc_overlay_rules
28
                WHERE module = 'source' AND filter = 'batchimport'
29
        }
30
            );
31
            say $out "Added existing batchimport overlay rules as add_to_basket rules";
32
        } else {
33
            say_info(
34
                $out,
35
                "No existing batchimport marc_overlay_rules found or existing add_to_basket rules found, not updating"
36
            );
37
        }
38
39
    },
40
};
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marc-overlay-rules.tt (-1 / +3 lines)
Lines 273-278 Link Here
273
                                            <span>Staff interface MARC editor</span>
273
                                            <span>Staff interface MARC editor</span>
274
                                        [% CASE 'batchimport' %]
274
                                        [% CASE 'batchimport' %]
275
                                            <span>Staged MARC import</span>
275
                                            <span>Staged MARC import</span>
276
                                        [% CASE 'add_to_basket' %]
277
                                            <span>Add to basket</span>
276
                                        [% CASE 'z3950' %]
278
                                        [% CASE 'z3950' %]
277
                                            <span>Z39.50</span>
279
                                            <span>Z39.50</span>
278
                                        [% CASE 'bulkmarkimport' %]
280
                                        [% CASE 'bulkmarkimport' %]
Lines 505-510 Link Here
505
                batchmod: _("Batch record modification"),
507
                batchmod: _("Batch record modification"),
506
                intranet: _("Staff interface MARC editor"),
508
                intranet: _("Staff interface MARC editor"),
507
                batchimport: _("Staged MARC import"),
509
                batchimport: _("Staged MARC import"),
510
                add_to_basket: _("Add to basket"),
508
                z3950: _("Z39.50"),
511
                z3950: _("Z39.50"),
509
                bulkmarcimport: _("bulkmarcimport.pl"),
512
                bulkmarcimport: _("bulkmarcimport.pl"),
510
                import_lexile: _("import_lexile.pl")
513
                import_lexile: _("import_lexile.pl")
511
- 

Return to bug 41029