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

(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 848-854 if ( $op eq "addbiblio" ) { Link Here
848
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
848
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
849
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
849
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
850
        my $oldbibitemnum;
850
        my $oldbibitemnum;
851
        my $marc_modification_template_name = C4::Context->preference("EditBiblioMarcModificationTemplate");
851
        my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate");
852
        if ($marc_modification_template_name) {
852
        if ($marc_modification_template_name) {
853
            my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();
853
            my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();
854
            if ($template) {
854
            if ($template) {
(-)a/installer/data/mysql/atomicupdate/bug_18138-edit-biblio-marc-modification-template-syspref.sql (-1 / +1 lines)
Line 1 Link Here
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('EditBiblioMarcModificationTemplate', '', '', 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free');
1
INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type`) VALUES ('SaveBiblioMarcModificationTemplate', '', '', 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free');
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +1 lines)
Lines 150-156 Cataloging: Link Here
150
            - "<br/>NOTE: Use a dollar sign between field and subfield like 123$a."
150
            - "<br/>NOTE: Use a dollar sign between field and subfield like 123$a."
151
        -
151
        -
152
            - Apply the MARC modification template with name
152
            - Apply the MARC modification template with name
153
            - pref: EditBiblioMarcModificationTemplate
153
            - pref: SaveBiblioMarcModificationTemplate
154
              class: short
154
              class: short
155
            - on records saved using the staff client simple MARC editor, advanced editor or HTTP API.
155
            - on records saved using the staff client simple MARC editor, advanced editor or HTTP API.
156
    Display:
156
    Display:
(-)a/svc/bib (-1 / +1 lines)
Lines 116-122 sub update_bib { Link Here
116
            }
116
            }
117
        }
117
        }
118
118
119
        my $marc_modification_template_name = C4::Context->preference("EditBiblioMarcModificationTemplate");
119
        my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate");
120
        if ($marc_modification_template_name) {
120
        if ($marc_modification_template_name) {
121
            my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();
121
            my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();
122
            if ($template) {
122
            if ($template) {
(-)a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t (-4 / +3 lines)
Lines 87-94 subtest 'Templates applied using simple and advanced MARC Editor' => sub { Link Here
87
    isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved');
87
    isa_ok($saved_record_250_field, 'MARC::Field', 'Field with tag 250 has been saved');
88
    is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio');
88
    is($saved_record_250_field->subfield('a'), '250 bottles of beer on the wall', 'Field 250a has the same value passed to AddBiblio');
89
89
90
    my $old_template_preference = C4::Context->preference('EditBiblioMarcModificationTemplate');
90
    my $old_template_preference = C4::Context->preference('SaveBiblioMarcModificationTemplate');
91
    C4::Context->set_preference('EditBiblioMarcModificationTemplate', 'TEST');
91
    C4::Context->set_preference('SaveBiblioMarcModificationTemplate', 'TEST');
92
92
93
    my $agent = Test::WWW::Mechanize->new(autocheck => 1);
93
    my $agent = Test::WWW::Mechanize->new(autocheck => 1);
94
94
Lines 150-154 EOF Link Here
150
    # Clean up
150
    # Clean up
151
    DelBiblio($biblionumber);
151
    DelBiblio($biblionumber);
152
    DelModificationTemplate($template_id);
152
    DelModificationTemplate($template_id);
153
    C4::Context->set_preference('EditBiblioMarcModificationTemplate', $old_template_preference);
153
    C4::Context->set_preference('SaveBiblioMarcModificationTemplate', $old_template_preference);
154
};
154
};
155
- 

Return to bug 18138