From 1ce4730d374c57e5e6f9abffe1bff112a8485cc5 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 Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens --- .../en/modules/tools/batch_delete_records.tt | 65 ++++++++++++------- .../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 5e57f8610f..5bd351381f 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.39.5