Bugzilla – Attachment 80996 Details for
Bug 19265
Advanced Editor - Rancor - Add ability to export selected records from and import records into an import batch
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19265: Fix rebase issues (move js to footer)
Bug-19265-Fix-rebase-issues-move-js-to-footer.patch (text/plain), 13.39 KB, created by
Cori Lynn Arnold
on 2018-10-22 21:26:06 UTC
(
hide
)
Description:
Bug 19265: Fix rebase issues (move js to footer)
Filename:
MIME Type:
Creator:
Cori Lynn Arnold
Created:
2018-10-22 21:26:06 UTC
Size:
13.39 KB
patch
obsolete
>From a7dc7aca934ac111a385d3d67cff54f6ec48d548 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 24 Jul 2018 17:35:07 +0000 >Subject: [PATCH] Bug 19265: Fix rebase issues (move js to footer) > >--- > .../prog/en/modules/tools/manage-marc-import.tt | 212 ++++----------------- > 1 file changed, 34 insertions(+), 178 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >index d7a41b3a02..561786ce9d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >@@ -9,176 +9,6 @@ > </title> > [% INCLUDE 'doc-head-close.inc' %] > [% Asset.css("css/datatables.css") | $raw %] >-<script type="text/javascript" src="[% interface %]/[% theme %]/js/background-job-progressbar.js"></script> >-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" /> >-[% INCLUDE 'datatables.inc' %] >-<script type="text/javascript"> >-//<![CDATA[ >-$(document).ready(function(){ >- $("#staged-record-matching-rules select").change(function(){ >- var str = $(this).attr("id"); >- $("#reset_"+str).parent().show(); >- }); >- $("a.reset").click(function(){ >- var str = $(this).attr("id"); >- str = str.replace("reset_","") >- $("#"+str+" option[selected='selected']").attr("selected","selected"); >- $(this).parent().hide(); >- }); >- >- [% IF import_batch_id %] >- var checkedRecords = {}; >- $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { >- "bAutoWidth": false, >- "bFilter": false, >- "bProcessing": true, >- "bServerSide": true, >- "sAjaxSource": 'batch_records_ajax.pl', >- "sPaginationType": "full_numbers", >- "sDom": '<"top pager"iflp>rt<"bottom pager"flp><"clear">', >- "aaSorting": [ [ 1, 'asc' ] ], >- "aoColumns": [ >- { >- "bSortable": false, >- "mDataProp": null, >- "sDefaultContent": '' >- }, >- { "mDataProp": "import_record_id" }, >- { "mDataProp": "citation" }, >- { "mDataProp": "status" }, >- { "mDataProp": "overlay_status" }, >- { "mDataProp": "match_citation" }, >- { "mDataProp": "diff_url" }, >- { "mDataProp": "matched" }, >- { >- "bSortable": false, >- "mDataProp": null, >- "sDefaultContent": '' >- } >- ], >- "fnServerData": function ( sSource, aoData, fnCallback ) { >- aoData.push( { "name": "import_batch_id", "value": [% import_batch_id %] } ); >- >- $.ajax({ >- 'dataType': 'json', >- 'type': 'POST', >- 'url': sSource, >- 'data': aoData, >- 'success': function(json){ >- fnCallback(json); >- } >- }); >- }, >- "fnRowCallback": function( nRow, aData, iDisplayIndex, iDisplayIndexFull ) { >- [% IF ( record_type == 'auth' ) %] >- var record_details_url = "/cgi-bin/koha/authorities/detail.pl?authid="; >- [% ELSE %] >- var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber="; >- [% END %] >- >- var record_id = aData['import_record_id']; >- var $checkbox = $('<input type="checkbox"></input>'); >- $('td:eq(0)', nRow).append($checkbox); >- $checkbox.prop( 'checked', checkedRecords[record_id] ); >- $checkbox.change( function() { >- if ( this.checked ) { >- checkedRecords[record_id] = true; >- } else { >- delete checkedRecords[record_id]; >- } >- } ); >- >- $('td:eq(2)', nRow).html( >- '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '" class="previewMARC">' + aData['citation'] + '</a>' >- ); >- >- $('td:eq(3)', nRow).html( >- aData['status'] == 'imported' ? _("Imported") : >- aData['status'] == 'ignored' ? _("Ignored") : >- aData['status'] == 'reverted' ? _("Reverted") : >- aData['status'] == 'staged' ? _("Staged") : >- aData['status'] == 'error' ? _("Error") : >- aData['status'] >- ); >- >- $('td:eq(4)', nRow).html( >- aData['overlay_status'] == 'no_match' ? _("No match") : >- aData['overlay_status'] == 'match_applied' ? _("Match applied") : >- aData['overlay_status'] == 'auto_match' ? _("Match found") : >- aData['overlay_status'] >- ); >- >- if ( aData['match_id'] ) { >- [% IF ( record_type == 'auth' ) -%] >- var matching_msg = _("Matches authority %s (score=%s):%s"); >- [%- ELSE -%] >- var matching_msg = _("Matches biblio %s (score=%s):%s"); >- [%- END %] >- $('td:eq(4)', nRow).html( >- matching_msg.format(aData['match_id'], aData['score'], >- '<a target="_blank" href="' + record_details_url >- + aData['match_id'] + '">' + aData['match_citation'] + '</a>') >- ); >- } >- if (aData['diff_url']){ >- $('td:eq(6)', nRow).html( >- '<a rel="gb_page_center[960,600]" href="'+aData['diff_url']+'">View</a>' >- ); >- } >- $('td:eq(7)', nRow).html( >- '<a target="_blank" href="' + record_details_url >- + aData['matched'] + '">' + aData['matched'] + '</a>' >- ); >- $('td:eq(8)', nRow).html( >- '<a target="_blank" href="/cgi-bin/koha/cataloguing/editor.pl#batch:[% import_batch_id %]/' + record_id >- + '">' + _("Edit") + '</a>' >- ); >- }, >- })); >- $("#import_batch_form").on("submit",function(){ >- return submitBackgroundJob( document.getElementById("import_batch_form") ); >- }); >- $("#revert_batch_form").on("submit",function(){ >- return confirm( _("Are you sure you want to undo the import of this batch into the catalog?") ) && submitBackgroundJob( document.getElementById("revert_batch_form") ); >- }); >- $('#export-selected').click( function() { >- var options = { >- import_record_id: $.map( checkedRecords, function( undef, key ) { return key; } ).join('|'), >- }; >- >- if ( options.import_record_id.length == 0 ) return false;_ >- >- window.open( '/cgi-bin/koha/svc/cataloguing/import_batches/' + [% import_batch_id %] + '?download=1&' + $.param( options ) ); >- return false; >- }); >- $('#import-additional').click( function() { >- window.open( '/cgi-bin/koha/tools/stage-marc-import.pl?existing_batch_id=' + [% import_batch_id %] ); >- return false; >- }); >- [% END %] >- $("body").on("click",".previewMARC", function(e){ >- e.preventDefault(); >- var ltitle = $(this).text(); >- var page = $(this).attr("href"); >- $("#marcPreviewLabel").text(ltitle); >- $("#marcPreview .modal-body").load(page + " table"); >- $('#marcPreview').modal({show:true}); >- }); >- $("#marcPreview").on("hidden", function(){ >- $("#marcPreviewLabel").html(""); >- $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/spinner-small.gif\" alt=\"\" /> "+_("Loading")+"</div>"); >- }); >- $(".batch_form").on("submit",function(){ >- if( $(this).hasClass("batch_delete") ){ >- return confirm( _("Are you sure you want to permanently delete this batch?") ); >- } else { >- return confirm( _("Clear all reservoir records staged in this batch? This cannot be undone.") ); >- } >- }); >-}); >- >-//]]> >-</script> > <style type="text/css"> > #jobpanel,#jobstatus,#jobfailed { display : none; } > span.change-status { font-style:italic; color:#666; display:none; } >@@ -514,8 +344,8 @@ $(document).ready(function(){ > > [% IF import_batch_id %] > <div id="toolbar" class="btn-toolbar"> >- <button class="btn btn-small" id="import-additional" title="Import extra records into this batch"><i class="icon-plus"></i> <span>Import additional records</span></button> >- <button class="btn btn-small" id="export-selected" title="Import extra records into this batch"><i class="fa fa-hdd-o"></i> <span>Export selected records</span></button> >+ <button class="btn btn-default btn-sm" id="import-additional" title="Import extra records into this batch"><i class="icon-plus"></i> <span>Import additional records</span></button> >+ <button class="btn btn-default btn-sm" id="export-selected" title="Export selected records from this batch"><i class="fa fa-hdd-o"></i> <span>Export selected records</span></button> > </div> > > <table id="records-table"> >@@ -577,6 +407,7 @@ $(document).ready(function(){ > }); > > [% IF import_batch_id %] >+ var checkedRecords = {}; > $("#records-table").dataTable($.extend(true, {}, dataTablesDefaults, { > "bAutoWidth": false, > "bFilter": false, >@@ -614,11 +445,24 @@ $(document).ready(function(){ > var record_details_url = "/cgi-bin/koha/catalogue/detail.pl?biblionumber="; > [% END %] > >- $('td:eq(1)', nRow).html( >+ var record_id = aData['import_record_id']; >+ var $checkbox = $('<input type="checkbox"></input>'); >+ >+ $('td:eq(0)', nRow).append($checkbox); >+ $checkbox.prop( 'checked', checkedRecords[record_id] ); >+ $checkbox.change( function() { >+ if ( this.checked ) { >+ checkedRecords[record_id] = true; >+ } else { >+ delete checkedRecords[record_id]; >+ } >+ }); >+ >+ $('td:eq(2)', nRow).html( > '<a href="/cgi-bin/koha/catalogue/showmarc.pl?importid=' + aData['import_record_id'] + '&viewas=html" class="previewMARC">' + aData['citation'] + '</a>' > ); > >- $('td:eq(2)', nRow).html( >+ $('td:eq(3)', nRow).html( > aData['status'] == 'imported' ? _("Imported") : > aData['status'] == 'ignored' ? _("Ignored") : > aData['status'] == 'reverted' ? _("Reverted") : >@@ -627,7 +471,7 @@ $(document).ready(function(){ > aData['status'] > ); > >- $('td:eq(3)', nRow).html( >+ $('td:eq(4)', nRow).html( > aData['overlay_status'] == 'no_match' ? _("No match") : > aData['overlay_status'] == 'match_applied' ? _("Match applied") : > aData['overlay_status'] == 'auto_match' ? _("Match found") : >@@ -647,14 +491,18 @@ $(document).ready(function(){ > ); > } > if (aData['diff_url']){ >- $('td:eq(5)', nRow).html( >- '<a href="'+aData['diff_url']+'">' + _("View") + '</a>' >+ $('td:eq(6)', nRow).html( >+ '<a rel="gb_page_center[960,600]" href="'+aData['diff_url']+'">View</a>' > ); > } >- $('td:eq(6)', nRow).html( >+ $('td:eq(7)', nRow).html( > '<a target="_blank" href="' + record_details_url > + aData['matched'] + '">' + aData['matched'] + '</a>' > ); >+ $('td:eq(8)', nRow).html( >+ '<a target="_blank" href="/cgi-bin/koha/cataloguing/editor.pl#batch:[% import_batch_id %]/' + record_id >+ + '">' + _("Edit") + '</a>' >+ ); > }, > })); > $("#import_batch_form").on("submit",function(){ >@@ -663,6 +511,14 @@ $(document).ready(function(){ > $("#revert_batch_form").on("submit",function(){ > return confirm( _("Are you sure you want to undo the import of this batch into the catalog?") ) && submitBackgroundJob( document.getElementById("revert_batch_form") ); > }); >+ $('#export-selected').click( function() { >+ var options = { >+ import_record_id: $.map( checkedRecords, function( undef, key ) { return key; } ).join('|'), >+ }; >+ if ( options.import_record_id.length == 0 ) return false;_ >+ window.open( '/cgi-bin/koha/svc/cataloguing/import_batches/' + [% import_batch_id %] + '?download=1&' + $.param( options ) ); >+ return false; >+ }); > [% END %] > $("body").on("click",".previewMARC", function(e){ > e.preventDefault(); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 19265
:
66898
|
66899
|
66900
|
77245
|
77246
|
77247
|
77248
|
80993
|
80994
|
80995
|
80996
|
85372
|
85373
|
85374
|
85375
|
85380
|
85381
|
85382
|
85383