From 98d5fd63a624fa46de1278ffeee2843cca1c7c1b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 12 Nov 2018 14:50:31 -0300 Subject: [PATCH] Bug 12759: Pass records from selected tab To remove ambiguity we should not process the records from other tabs. Signed-off-by: Katrin Fischer --- .../prog/en/modules/tools/batch_delete_records.tt | 65 ++++++++++++++-------- .../en/modules/tools/batch_record_modification.tt | 64 +++++++++++++-------- 2 files changed, 81 insertions(+), 48 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt index 63df143b72..0b9ffd8032 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt @@ -57,7 +57,7 @@ [% END %] [% IF op == 'form' %] -
+
Record type
    @@ -70,12 +70,12 @@
    -
    +
    Use a file
      @@ -85,26 +85,28 @@  
    -
    -
    - Or select a list of records -
      -
    1. - - -
    2. -
    -
    -   -
    + [% IF lists.count %] +
    +
    + Or select a list of records +
      +
    1. + + +
    2. +
    +
    +   +
    + [% END %] -
    +
    Or enter a list of record numbers
      @@ -306,6 +308,21 @@ return false; } }); + + $("#record_ids_selection").on("submit", function(e){ + var tab = $(this).find('.ui-tabs-active:first a').attr('href'); + if ( tab == '#uploadfile_tab' ) { + $("#shelf_number").empty(''); + $("#recordnumber_list").val(''); + } else if ( tab == '#shelves_tab' ) { + $("#uploadfile").val('') + $("#recordnumber_list").val(''); + } else { // enterlist + $("#uploadfile").val('') + $("#shelf_number").empty(''); + } + }); + }); [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt index a8f9b7cc53..652c74e53f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_record_modification.tt @@ -61,7 +61,7 @@ [% END %] [% IF view == 'form' %] - +
      Record type
        @@ -74,12 +74,12 @@
        -
        +
        Use a file
          @@ -89,26 +89,28 @@  
        -
        -
        - Or select a list of records -
          -
        1. - - -
        2. -
        -
        -   -
        + [% IF lists.count %] +
        +
        + Or select a list of records +
          +
        1. + + +
        2. +
        +
        +   +
        + [% END %] -
        +
        Or enter a list of record numbers
          @@ -338,6 +340,20 @@ return submitBackgroundJob(document.getElementById("process")); }); + $("#record_ids_selection").on("submit", function(e){ + var tab = $(this).find('.ui-tabs-active:first a').attr('href'); + if ( tab == '#uploadfile_tab' ) { + $("#shelf_number").empty(''); + $("#recordnumber_list").val(''); + } else if ( tab == '#shelves_tab' ) { + $("#uploadfile").val('') + $("#recordnumber_list").val(''); + } else { // enterlist + $("#uploadfile").val('') + $("#shelf_number").empty(''); + } + }); + $("#marc_modification_template_id").change(function(){ var url = "/cgi-bin/koha/svc/records/preview?" var mmtid = $(this).val(); -- 2.11.0