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

(-)a/admin/preferences.pl (+4 lines)
Lines 28-33 use C4::ClassSource qw( GetClassSources GetClassSource ); Link Here
28
use C4::Output qw( output_html_with_http_headers );
28
use C4::Output qw( output_html_with_http_headers );
29
use C4::Templates;
29
use C4::Templates;
30
use Koha::Acquisition::Currencies;
30
use Koha::Acquisition::Currencies;
31
use Koha::MarcModificationTemplates;
31
use IO::File;
32
use IO::File;
32
use YAML::XS;
33
use YAML::XS;
33
use Encode;
34
use Encode;
Lines 100-105 sub _get_chunk { Link Here
100
            } elsif ( $options{choices} eq 'patron-categories' ) {
101
            } elsif ( $options{choices} eq 'patron-categories' ) {
101
                $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search };
102
                $options{choices} = { map { $_->categorycode => $_->description } Koha::Patron::Categories->search };
102
                $add_blank = 1;
103
                $add_blank = 1;
104
            } elsif ( $options{choices} eq 'modification-templates' ) {
105
                $options{choices} = { map { $_->template_id => $_->name } Koha::MarcModificationTemplates->search };
106
                $add_blank = 1;
103
            } else {
107
            } else {
104
                die 'Unrecognized source of preference values: ' . $options{'choices'};
108
                die 'Unrecognized source of preference values: ' . $options{'choices'};
105
            }
109
            }
(-)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 ('SaveBiblioMarcModificationTemplate', '', NULL, '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', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'modification-templates');
(-)a/installer/data/mysql/mandatory/sysprefs.sql (-1 / +1 lines)
Lines 586-592 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
586
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
586
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
587
('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'),
587
('RoutingListNote','To change this note edit <a href=\"/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped\">RoutingListNote</a> system preference.','70|10','Define a note to be shown on all routing lists','Textarea'),
588
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
588
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
589
('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'Free'),
589
('SaveBiblioMarcModificationTemplate', '', NULL, 'MARC modification template applied when saving bibliographic record in staff client or HTTP API', 'modification-templates'),
590
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
590
('SCOAllowCheckin','0','','If enabled, patrons may return items through the Web-based Self Checkout','YesNo'),
591
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
591
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
592
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
592
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref (-1 / +1 lines)
Lines 161-167 Cataloging: Link Here
161
        -
161
        -
162
            - Apply the MARC modification template with name
162
            - Apply the MARC modification template with name
163
            - pref: SaveBiblioMarcModificationTemplate
163
            - pref: SaveBiblioMarcModificationTemplate
164
              class: short
164
              class: modification-templates
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:
167
        -
167
        -
(-)a/t/db_dependent/www/EditBiblioMarcModificationTemplatePreference.t (-4 / +3 lines)
Lines 23-29 require HTTP::Request; Link Here
23
use MARC::Record;
23
use MARC::Record;
24
use XML::Simple;
24
use XML::Simple;
25
use C4::MarcModificationTemplates;
25
use C4::MarcModificationTemplates;
26
use C4::Biblio;
26
use C4::Biblio qw(AddBiblio ModBiblioMarc GetMarcBiblio);
27
27
28
eval{
28
eval{
29
    use C4::Context;
29
    use C4::Context;
Lines 82-88 subtest 'Templates applied using simple and advanced MARC Editor' => sub { Link Here
82
    );
82
    );
83
    my ($biblionumber) = AddBiblio($record, '');
83
    my ($biblionumber) = AddBiblio($record, '');
84
84
85
    my $saved_record = GetMarcBiblio({ biblio => $biblionumber, embed_items => 0 });
85
    my $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 });
86
    my $saved_record_250_field = $saved_record->field('250');
86
    my $saved_record_250_field = $saved_record->field('250');
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');
Lines 109-115 subtest 'Templates applied using simple and advanced MARC Editor' => sub { Link Here
109
        'Save bibliographic record using simple MARC editor'
109
        'Save bibliographic record using simple MARC editor'
110
    );
110
    );
111
111
112
    $saved_record = GetMarcBiblio({ biblio => $biblionumber, embed_items => 0 });
112
    $saved_record = GetMarcBiblio({ biblionumber => $biblionumber, embed_items => 0 });
113
    $saved_record_250_field = $saved_record->field('250');
113
    $saved_record_250_field = $saved_record->field('250');
114
    is($saved_record_250_field->subfield('a'), '251 bottles of beer on the wall', 'Field with tag 250 has been modified by MARC modification template');
114
    is($saved_record_250_field->subfield('a'), '251 bottles of beer on the wall', 'Field with tag 250 has been modified by MARC modification template');
115
115
116
- 

Return to bug 18138