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 543-548 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
543
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
543
('RoutingListAddReserves','0','','If ON the patrons on routing lists are automatically added to holds on the issue.','YesNo'),
544
('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'),
544
('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'),
545
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
545
('RoutingSerials','1',NULL,'If ON, serials routing is enabled','YesNo'),
546
('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'),
546
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
547
('SCOMainUserBlock','','70|10','Add a block of HTML that will display on the self checkout screen','Textarea'),
547
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
548
('SCOUserCSS','',NULL,'Add CSS to be included in the SCO module in an embedded <style> tag.','free'),
548
('SCOUserJS','',NULL,'Define custom javascript for inclusion in the SCO module','free'),
549
('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 284-290 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
284
        'iso2709': {
284
        'iso2709': {
285
            saveLabel: _("Save as MARC (.mrc) file"),
285
            saveLabel: _("Save as MARC (.mrc) file"),
286
            save: function( id, record, done ) {
286
            save: function( id, record, done ) {
287
                saveAs( new Blob( [record.toISO2709()], { 'type': 'application/octet-stream;charset=utf-8' } ), 'record.mrc' );
287
                var recname = state.recordID+'.mrc';
288
[% IF (Koha.Preference('SaveRecordbyControlNumber') == '1') %]
289
                var controlnumfield = record.field('001');
290
                if(controlnumfield) {
291
                        recname = controlnumfield.subfield('@')+'.mrc';
292
                }
293
[% END %]
294
                saveAs( new Blob( [record.toISO2709()], { 'type': 'application/octet-stream;charset=utf-8' } ), recname );
288
295
289
                done( {} );
296
                done( {} );
290
            }
297
            }
Lines 292-298 require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr Link Here
292
        'marcxml': {
299
        'marcxml': {
293
            saveLabel: _("Save as MARCXML (.xml) file"),
300
            saveLabel: _("Save as MARCXML (.xml) file"),
294
            save: function( id, record, done ) {
301
            save: function( id, record, done ) {
295
                saveAs( new Blob( [record.toXML()], { 'type': 'application/octet-stream;charset=utf-8' } ), 'record.xml' );
302
                var recname = state.recordID+'.xml';
303
[% IF (Koha.Preference('SaveRecordbyControlNumber') == '1') %]
304
                var controlnumfield = record.field('001');
305
                if(controlnumfield) {
306
                        recname = controlnumfield.subfield('@')+'.xml';
307
                }
308
[% END %]
309
                saveAs( new Blob( [record.toXML()], { 'type': 'application/octet-stream;charset=utf-8' } ), recname );
296
310
297
                done( {} );
311
                done( {} );
298
            }
312
            }
299
- 

Return to bug 24108