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

(-)a/installer/data/mysql/atomicupdate/bug_24108-add_SaveRecordbyControlNumber_syspref.sql (+1 lines)
Line 0 Link Here
1
INSERT IGNORE INTO systempreferences (variable, value, explanation, options, type) VALUES ('SaveRecordbyControlNumber', '0', 'If set, advanced editor (Rancor) will use the control number field to populate the name of the save file, otherwise it uses the biblionumber.', NULL, 'YesNo');
(-)a/installer/data/mysql/sysprefs.sql (+1 lines)
Lines 549-554 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
549
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
549
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
550
('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'),
550
('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'),
551
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
551
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
552
('SaveRecordbyControlNumber','0',NULL,'If set, advanced editor (Rancor) will use the control number field to populate the name of the save file, otherwise it uses the biblionumber.','YesNo'),
552
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
553
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
553
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
554
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
554
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
555
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc (-3 / +16 lines)
Lines 286-292 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
286
        'iso2709': {
286
        'iso2709': {
287
            saveLabel: _("Save as MARC (.mrc) file"),
287
            saveLabel: _("Save as MARC (.mrc) file"),
288
            save: function( id, record, done ) {
288
            save: function( id, record, done ) {
289
                saveAs( new Blob( [record.toISO2709()], { 'type': 'application/octet-stream;charset=utf-8' } ), 'record.mrc' );
289
                var recname = state.recordID+'.mrc';
290
[% IF (Koha.Preference('SaveRecordbyControlNumber') == '1') %]
291
                var controlnumfield = record.field('001');
292
                if(controlnumfield) {
293
                        recname = controlnumfield.subfield('@')+'.mrc';
294
                }
295
[% END %]
296
                saveAs( new Blob( [record.toISO2709()], { 'type': 'application/octet-stream;charset=utf-8' } ), recname );
290
297
291
                done( {} );
298
                done( {} );
292
            }
299
            }
Lines 294-300 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
294
        'marcxml': {
301
        'marcxml': {
295
            saveLabel: _("Save as MARCXML (.xml) file"),
302
            saveLabel: _("Save as MARCXML (.xml) file"),
296
            save: function( id, record, done ) {
303
            save: function( id, record, done ) {
297
                saveAs( new Blob( [record.toXML()], { 'type': 'application/octet-stream;charset=utf-8' } ), 'record.xml' );
304
                var recname = state.recordID+'.xml';
305
[% IF (Koha.Preference('SaveRecordbyControlNumber') == '1') %]
306
                var controlnumfield = record.field('001');
307
                if(controlnumfield) {
308
                        recname = controlnumfield.subfield('@')+'.xml';
309
                }
310
[% END %]
311
                saveAs( new Blob( [record.toXML()], { 'type': 'application/octet-stream;charset=utf-8' } ), recname );
298
312
299
                done( {} );
313
                done( {} );
300
            }
314
            }
301
- 

Return to bug 24108