From 8e39d64a4729041601cf74b9824cbe9e85193599 Mon Sep 17 00:00:00 2001 From: Cori Lynn Arnold Date: Fri, 17 Jan 2020 20:01:35 +0000 Subject: [PATCH] Bug 24429: Advanced editor - Add ability to generate an export file as cataloger saves Adds the ability for catalogers to *automatically* save a list of bibs to export as they are cataloging. To test, apply patch: 0/Verify that the advanced editor is enabled by going to "Administration" and searching for "EnableAdvancedCatalogingEditor" 1/Set it to "Enable" if it isn't already. 2/Go to "Cataloging", click on "Advanced editor" 3/Click on "Export" button (verify a modal window comes up) 4/Click on the link for "New Export File", name the export file 5/Close the modal window 6/Search for a record by entering "specious" in the keyword box and hitting enter 7/Click "import" on a record 8/Make some changes and hit "Save", note the bib number 9/Repeat steps 6-8 for several records, getting records from the catalog and importing through the "import" button in the UI 10/Click on "Export..." button 11/Click on the link for the name you created in step 4 12/Verify the bib numbers from step 8 are in the Export Files Editor 13/Click "Generate Export File" 14/Verify that all the records for every bib listed is in the file generated 15/Repeat steps with different file names / records --- koha-tmpl/intranet-tmpl/prog/css/cateditor.css | 22 +++++++++++++++++++++ .../prog/en/includes/cateditor-ui.inc | 23 ++++++++++++---------- 2 files changed, 35 insertions(+), 10 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/cateditor.css b/koha-tmpl/intranet-tmpl/prog/css/cateditor.css index b499daebb0..b8861974b5 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/cateditor.css +++ b/koha-tmpl/intranet-tmpl/prog/css/cateditor.css @@ -383,6 +383,28 @@ body { font-size: 115%; } +#export-list > li + li { + margin-top: -2px; +} + +#export-list .active { + background: #EDF4F6; + border-color: none; +} + +#export-list a { + display: block; + padding: 6px; +} + +#export-list a:focus { + outline: none; +} + +#export-list .active .export-info { + display: block; +} + #export-editor { display: flex; flex-direction: column; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc index 7b35898819..59a816d86b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc @@ -275,6 +275,17 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr save: function( id, record, done ) { function finishCb( data ) { done( { error: data.error, newRecord: data.marcxml && data.marcxml[0], newId: data.biblionumber && [ 'catalog', data.biblionumber ] } ); + + //Add the record to the exportRecords list if there is one + if(Preferences.user.exportRecords) { + var export_list = $.map (Preferences.user.exportRecords, function (exportRecord, name) { + return $.extend( { name: name}, exportRecord ); + }); + $.each ( export_list, function ( undef, exportRecord ) { + exportRecord.contents += "\n" + data.biblionumber; + storeExportRecord( exportRecord.name, { contents: exportRecord.contents} ); + } ); + } } if ( id ) { @@ -1047,16 +1058,6 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr saveRecord( backend + '/', editor, finishCb ); } - //Add the record to the exportRecords list if there is one - if(Preferences.user.exportRecords) { - var export_list = $.map (Preferences.user.exportRecords, function (exportRecord, name) { - return $.extend( { name: name}, exportRecord ); - }); - $.each ( export_list, function ( undef, exportRecord ) { - exportRecord.contents += "\n" + state.recordID; - storeExportRecord( exportRecord.name, { contents: exportRecord.contents} ); - } ); - } return false; } ); @@ -1310,6 +1311,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr $( window ).resize( onResize ).resize(); editor.focus(); } ); + + } if ( "[% auth_forwarded_hash | html %]" ) { -- 2.11.0