Bugzilla – Attachment 53646 Details for
Bug 16937
Remove the use of "onclick" from the manage staged MARC records template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 16937 [Revised] Remove "onclick" from the manage staged MARC records template
SIGNED-OFF-Bug-16937-Revised-Remove-onclick-from-t.patch (text/plain), 7.25 KB, created by
Owen Leonard
on 2016-07-22 13:14:04 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 16937 [Revised] Remove "onclick" from the manage staged MARC records template
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2016-07-22 13:14:04 UTC
Size:
7.25 KB
patch
obsolete
>From f92127640c1b7f4297f6c37c82fcaa1ff0b83161 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 18 Jul 2016 12:20:33 -0400 >Subject: [PATCH] [SIGNED-OFF] Bug 16937 [Revised] Remove "onclick" from the > manage staged MARC records template >Content-Type: text/plain; charset="utf-8" > >This patch revises the manage staged MARC records template, removing >"onclick" attributes from the markup and defining those events in the >script. > >To test, apply the patch and go to Tools -> Manage staged MARC records. > >- If necessary, stage a MARC file for import. >- Click the name of the staged file and then the "Import this batch into > the catalog" button. The batch should be correctly imported. >- Return to the list of staged MARC files. >- Click the name of an imported file and then the "Undo import into > catalog" button. The import should be reverted. >- Return to the list of staged MARC files. >- Click the "Clean" button for any record. Confirm that the batch is > cleaned. >- For any cleaned record, click the "Delete" button. The batch should be > deleted. > >Signed-off-by: Hector Castro <hector.hecaxmmx@gmail.com> >Works as advertised > >QA revision: Corrected class name so that "delete" button triggers the >correct warning. >--- > .../prog/en/modules/tools/manage-marc-import.tt | 33 ++++++++++++++-------- > 1 file changed, 21 insertions(+), 12 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 a8a9572..f89ec73 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 >@@ -37,10 +37,6 @@ > [% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > //<![CDATA[ >-var MSG_CONFIRM_CLEAN = _("Clear all reservoir records staged in this batch? This cannot be undone."); >-var MSG_CONFIRM_UNDO_IMPORT = _("Are you sure you want to undo the import of this batch into the catalog?"); >-var MSG_CONFIRM_DELETE = _("Are you sure you want to permanently delete this batch?"); >- > $(document).ready(function(){ > $("#staged-record-matching-rules select").change(function(){ > var str = $(this).attr("id"); >@@ -134,6 +130,12 @@ $(document).ready(function(){ > ); > }, > })); >+ $("#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") ); >+ }); > [% END %] > $("body").on("click",".previewMARC", function(e){ > e.preventDefault(); >@@ -147,6 +149,13 @@ $(document).ready(function(){ > $("#marcPreviewLabel").html(""); > $("#marcPreview .modal-body").html("<div id=\"loading\"><img src=\"[% interface %]/[% theme %]/img/loading-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.") ); >+ } >+ }); > }); > > //]]> >@@ -339,13 +348,13 @@ $(document).ready(function(){ > > <div> > [% IF ( can_commit ) %] >- <form action="[% script_name %]" method="post"> >+ <form action="[% script_name %]" method="post" id="import_batch_form"> > <input type="hidden" name="op" value="commit-batch" /> > <input type="hidden" name="runinbackground" value="" /> > <input type="hidden" name="completedJobID" value="" /> > <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" /> > <fieldset class="action"> >- <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" onclick="return submitBackgroundJob(this.form);" /> >+ <input type="submit" class="button" name="mainformsubmit" value="Import this batch into the catalog" /> > <br/> > [% IF ( record_type != 'auth' ) %] > Add new bibliographic records into this framework: >@@ -362,12 +371,12 @@ $(document).ready(function(){ > <div id="jobfailed"></div></div> > [% END %] > [% IF ( can_revert ) %] >- <form action="[% script_name %]" method="post"> >+ <form action="[% script_name %]" method="post" id="revert_batch_form"> > <input type="hidden" name="op" value="revert-batch" /> > <input type="hidden" name="runinbackground" value="" /> > <input type="hidden" name="completedJobID" value="" /> > <input type="hidden" name="import_batch_id" value="[% import_batch_id %]" /> >- <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" onclick="return confirm(MSG_CONFIRM_UNDO_IMPORT) && submitBackgroundJob(this.form);" /></fieldset> >+ <fieldset class="action"><input type="submit" class="button" name="mainformsubmit" value="Undo import into catalog" /></fieldset> > </form> > <div id="jobpanel"><div id="jobstatus">Job progress: <div id="jobprogress"></div> <span id="jobprogresspercent">0</span>%</div> > <div id="jobfailed"></div></div> >@@ -454,16 +463,16 @@ Page > <td>[% batch_lis.num_items %][% IF ( batch_lis.num_items ) %] <a href="[% batch_lis.script_name %]?import_batch_id=[% batch_lis.import_batch_id %]&op=create_labels">(Create label batch)</a>[% END %]</td> > <td class="actions"> > [% IF ( batch_lis.can_clean ) %] >- <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" > >+ <form method="post" action="[% batch_lis.script_name %]" name="clean_batch_[% batch_lis.import_batch_id %]" id="clean_batch_[% batch_lis.import_batch_id %]" class="batch_form batch_clean" > > <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" /> > <input type="hidden" name="op" value="clean-batch" /> >- <button class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_CLEAN);"><i class="fa fa-eraser"></i> Clean</button> >+ <button type="submit" class="btn btn-mini"><i class="fa fa-eraser"></i> Clean</button> > </form> > [% ELSIF ( batch_lis.import_status == 'cleaned' ) %] >- <form method="post" action="/cgi-bin/koha/tools/manage-marc-import.pl" name="delete_batch_[% batch_lis.import_batch_id %]" id="delete_batch_[% batch_lis.import_batch_id %]"> >+ <form method="post" action="/cgi-bin/koha/tools/manage-marc-import.pl" name="delete_batch_[% batch_lis.import_batch_id %]" id="delete_batch_[% batch_lis.import_batch_id %]" class="batch_form batch_delete"> > <input type="hidden" name="import_batch_id" value="[% batch_lis.import_batch_id %]" /> > <input type="hidden" name="op" value="delete-batch" /> >- <button class="btn btn-mini" onclick="return confirm(MSG_CONFIRM_DELETE);"><i class="fa fa-trash"></i> Delete</button> >+ <button type="submit" class="btn btn-mini"><i class="fa fa-trash"></i> Delete</button> > </form> > [% END %] > </td> >-- >2.1.4
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 16937
:
53478
|
53509
|
53529
|
53646
|
53702