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

(-)a/cataloguing/addbiblio.pl (-1 / +1 lines)
Lines 851-857 if ( $op eq "addbiblio" ) { Link Here
851
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
851
    # it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate)
852
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
852
    if ( !$duplicatebiblionumber or $confirm_not_duplicate ) {
853
        my $oldbibitemnum;
853
        my $oldbibitemnum;
854
        my $marc_modification_template_name = C4::Context->preference("EditBiblioMarcModificationTemplate");
854
        my $marc_modification_template_name = C4::Context->preference("SaveBiblioMarcModificationTemplate");
855
        if ($marc_modification_template_name) {
855
        if ($marc_modification_template_name) {
856
            my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();
856
            my $template = firstval { $_->{'name'} eq $marc_modification_template_name } GetModificationTemplates();
857
            if ($template) {
857
            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 160-166 Cataloging: Link Here
160
            - ". <br/><strong>NOTE:</strong> Use a dollar sign between field and subfield like 123$a."
160
            - ". <br/><strong>NOTE:</strong> Use a dollar sign between field and subfield like 123$a."
161
        -
161
        -
162
            - Apply the MARC modification template with name
162
            - Apply the MARC modification template with name
163
            - pref: EditBiblioMarcModificationTemplate
163
            - pref: SaveBiblioMarcModificationTemplate
164
              class: short
164
              class: short
165
            - on records saved using the staff client simple MARC editor, advanced editor or HTTP API.
165
            - on records saved using the staff client simple MARC editor, advanced editor or HTTP API.
166
    Display:
166
    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