From 0779e98ddf482e833936cb4a0f2985dcad2b45f6 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 12 Mar 2013 15:55:32 -0400 Subject: [PATCH] Bug 9782: hide cancel button when importing MARC bibliographic frameworks When importing frameworks the "cancel" button should be hidden once an import is initiated since it is not possible to cancel the import in progress. This patch uses this bug as an excuse to replace the old import/export pop-ups with modal dialogs for all import/export functions. To test: - Try exporting both the default framework and at least one other framework. - Try importing both a default framework and at least one other framework. - When importing, observe that the modal dialog controls are hidden as soon as the import is initiated. Signed-off-by: David Cook Signed-off-by: Katrin Fischer Works nicely, passes all tests and QA script. Also the modal works better on smaller screens. Signed-off-by: Galen Charlton --- .../prog/en/css/staff-global.css | 3 + .../prog/en/modules/admin/biblio_framework.tt | 155 +++++++++++------- 2 files changed, 99 insertions(+), 59 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index 2418043f35..9d4446cac7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -2392,7 +2392,10 @@ video { /* Bootstrap overrides */ .btn { border-color : #ADADAD #ADADAD #949494; +} +.btn.btn-link { + border : 0; } .btn-small .caret { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt index aa269ce4d9..50faf31841 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/biblio_framework.tt @@ -84,7 +84,7 @@ function Check(f) { } }); $('form.form_export').submit(function() { - $('.import_export_options').hide(); + $('.modal').modal("hide"); return true; }); $('form.form_import').submit(function() { @@ -93,7 +93,7 @@ function Check(f) { if (/(?:\.csv|\.sql|\.ods|\.xml)$/.test(obj.val())) { if (confirm(_("Do you really want to import the framework fields and subfields? This will overwrite the current configuration. For safety reasons please use the export option to make a backup"))) { var frameworkcode = $('#' + id + ' input:hidden[name=frameworkcode]').val(); - $('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"" + frameworkcode + "
" +_("Importing from file:")+"" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + ""); + $('#importing_' + frameworkcode).find("span").html(_("Importing to framework:")+"" + frameworkcode + ". " +_("Importing from file:")+"" + obj.val().replace(new RegExp("^.+[/\\\\]"),"") + ""); if (navigator.userAgent.toLowerCase().indexOf('msie') != -1) { var timestamp = new Date().getTime(); $('#importing_' + frameworkcode).find("img").attr('src', '[% interface %]/[% theme %]/img/loading-small.gif' + '?' +timestamp); @@ -101,6 +101,7 @@ function Check(f) { $('#importing_' + frameworkcode).css('display', 'block'); if (navigator.userAgent.toLowerCase().indexOf('firefox') == -1) $("body").css("cursor", "progress"); importing = true; + $(".modal-footer,.closebtn").hide(); return true; } else return false; @@ -192,40 +193,59 @@ function Check(f) { MARC structure     -
Export -
+ + + + Export + + -
+ -
Import -
+ + + + Import + + -
+ @@ -239,39 +259,56 @@ function Check(f) { Edit Delete -
Export -
-
-
- Export framework - -
    -
  1. -
  2. -
  3. -
  4. -
-
-
Cancel
+ + + Export + +
-
-
Import -
-
-
- Import [% frameworkcode %] framework structure (fields and subfields) from a spreadsheet file (.csv, .xml, .ods) or SQL file - - -
    -
  1. -
-
-
Cancel
-
-
-
+ + + + Import + + [% END %] -- 2.39.5